예제 #1
0
 public static RepoBrands FromDomainBrandToRepoBrand(this DomainBrands item)
 {
     return(new RepoBrands
     {
         BrandName = item.BrandName,
     });
 }
예제 #2
0
        public void CreateBrand(string brandName)
        {
            DomainBrands brand = new DomainBrands {
                BrandName = brandName
            };

            _Repositories.Brands.Create(brand.FromDomainBrandToRepoBrand());
        }
예제 #3
0
파일: Mapping.cs 프로젝트: AntonNagula/Auto
 public static AppCarBrand FromDomainBrandsToAppCarBrand(this DomainBrands item)
 {
     return(new AppCarBrand
     {
         Id = item.Id,
         BrandName = item.BrandName,
     });
 }
예제 #4
0
 //
 public void Create_Car(DomainCar item)
 {
     if (item.BrandId == 0)
     {
         int size = 1 + GetAllBrands().ToList().Count;
         item.BrandId = size;
         DomainBrands brand = new DomainBrands {
             BrandName = item.CarBrand
         };
         Brands.Add(brand);
         _Repositories.Brands.Create(brand.FromDomainBrandToRepoBrand());
     }
     else
     {
         item.CarBrand = Brands.FirstOrDefault(x => x.Id == item.BrandId).BrandName;
     }
     Cars.Add(item);
     _Repositories.Cars.Create(item.FromDomainCarToRepoCar());
 }
예제 #5
0
파일: Mapping.cs 프로젝트: AntonNagula/Auto
 public static string FromAppBrandToBrand(this DomainBrands item)
 {
     return(item.BrandName);
 }