Advertisement
otkalce

MVC Mapping

Apr 18th, 2023 (edited)
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | Source Code | 0 0
  1. public static class ServiceMapper
  2. {
  3.     public static IEnumerable<Models.Service> MapToBL(IEnumerable<Task10.DAL.Models.Service> services) =>
  4.         services.Select(x => MapToBL(x));
  5.  
  6.     public static Models.Service MapToBL(Task10.DAL.Models.Service service) =>
  7.         new Models.Service
  8.         {
  9.             Id = service.Id,
  10.             Name = service.Name,
  11.             Description = service.Description,
  12.             ImageUrl = service.ImageUrl,
  13.         };
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement