public ApiCategory Add(ApiCategory apiCategory) { db.Categories.Add(Mapper.Map <ApiCategory, Category>(apiCategory)); apiCategory.CatID = db.SaveChanges(); return(apiCategory); }
public ApiProduct Add(ApiProduct apiProduct) { db.Products.Add(Mapper.Map <ApiProduct, Product>(apiProduct)); apiProduct.ProID = db.SaveChanges(); return(apiProduct); }
public ApiRating Add(ApiRating apiRating) { db.Ratings.Add(Mapper.Map <ApiRating, Rating>(apiRating)); db.SaveChanges(); return(apiRating); }
public ApiStatuses Add(ApiStatuses apiStatus) { db.Statuses.Add(Mapper.Map <ApiStatuses, Status>(apiStatus)); apiStatus.SttID = db.SaveChanges(); return(apiStatus); }
public ApiOrder Add(ApiOrder apiOrder) { db.Orders.Add(Mapper.Map <ApiOrder, Order>(apiOrder)); apiOrder.OrderID = db.SaveChanges(); return(apiOrder); }
public ApiComment Add(ApiComment apiComment) { db.Comments.Add(Mapper.Map <ApiComment, Comment>(apiComment)); db.SaveChanges(); return(apiComment); }
public ApiProducer Add(ApiProducer apiProducer) { db.Producers.Add(Mapper.Map <ApiProducer, Producer>(apiProducer)); apiProducer.ProducerID = db.SaveChanges(); return(apiProducer); }
public ApiOrderDetail Add(ApiOrderDetail apiOrderDetail) { db.OrderDetails.Add(Mapper.Map <ApiOrderDetail, OrderDetail>(apiOrderDetail)); db.SaveChanges(); return(apiOrderDetail); }
public ApiUser Add(ApiUser apiUser) { var user = Mapper.Map <ApiUser, User>(apiUser); db.Users.Add(user); apiUser.f_ID = db.SaveChanges(); return(apiUser); }