In this case, there is a problem with the wiki. I wanted to use Automapper 5.2. I cannot find a simple end for a final example that shows a solid configuration with context. In context, I mean where do you put the configuration files and what is the difference between static and api instance?
I checked the DNRTV download, but it deals with version 1.0.
How do you install this package? I have a model called Client, as shown below.
public class Client : IEntityBase { public Client() { Jobs = new List<Job>(); } public int Id { get; set; } public int ClientNo { get; set; } public bool Company { get; set; } public string CompanyName { get; set; } public string ClientFirstName { get; set; } public DateTime DeActivated { get; set; } public bool Activity { get; set; } public DateTime DateCreated { get; set; } public DateTime DateUpdated { get; set; } public int? StateId { get; set; } public State State { get; set; } public int CreatorId { get; set; } public User Creator { get; set; } public ICollection<Job> Jobs { get; set; } }
and ClientViewModel:
public class ClientViewModel { public int Id { get; set; } public int ClientNo { get; set; } public bool Company { get; set; } public string CompanyName { get; set; } public string ClientFirstName { get; set; } public DateTime DeActivated { get; set; } public bool Activity { get; set; } public DateTime DateCreated { get; set; } public DateTime DateUpdated { get; set; } public int? StateId { get; set; } public int CreatorId { get; set; } public int[] Jobs { get; set; } }
I am not sure how to install AutoMapper regarding configuration. That is, they talk about the global.asax file, and I use the aspnet core. The file Global.asax is missing.
What do you insert in the Startup.cs file, if anything.
Given these two files above, what do I need to do to use Automapper with them?
Hi
asp.net-core automapper
si2030
source share