Beispiel #1
0
        public void CreateBrand(string brandName)
        {
            DomainBrands brand = new DomainBrands {
                BrandName = brandName
            };

            _Repositories.Brands.Create(brand.FromDomainBrandToRepoBrand());
        }
Beispiel #2
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());
 }