DEV Community

Mustafa  Çam
Mustafa Çam

Posted on

1 1 1 1

use camelcase in angular and asp.net web api json

example here =>

namespace DirectoryApi
{
    public class Directory
    {
        public int Id { get; set; }
        public string FirstName { get; set; } 
        public string LastName { get; set; } 
        public string Telephone { get; set; }
    }
}
Enter fullscreen mode Exit fullscreen mode

you can use FirstName but json returns "firstName". if you use it like this =>

*ngFor <li *ngFor="let directory of directories">
      {{ directory.FirstName }}  {{ directory.LastName }} - {{ directory.Telephone }} - <span>Naber</span>
    </li>
Enter fullscreen mode Exit fullscreen mode

this doesnt work but
this work firstName , lastName ,telephone

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay