Exemplo n.º 1
0
        public ApiCategory Add(ApiCategory apiCategory)
        {
            db.Categories.Add(Mapper.Map <ApiCategory, Category>(apiCategory));
            apiCategory.CatID = db.SaveChanges();

            return(apiCategory);
        }
Exemplo n.º 2
0
        public ApiProduct Add(ApiProduct apiProduct)
        {
            db.Products.Add(Mapper.Map <ApiProduct, Product>(apiProduct));
            apiProduct.ProID = db.SaveChanges();

            return(apiProduct);
        }
Exemplo n.º 3
0
        public ApiRating Add(ApiRating apiRating)
        {
            db.Ratings.Add(Mapper.Map <ApiRating, Rating>(apiRating));
            db.SaveChanges();

            return(apiRating);
        }
Exemplo n.º 4
0
        public ApiStatuses Add(ApiStatuses apiStatus)
        {
            db.Statuses.Add(Mapper.Map <ApiStatuses, Status>(apiStatus));
            apiStatus.SttID = db.SaveChanges();

            return(apiStatus);
        }
Exemplo n.º 5
0
        public ApiOrder Add(ApiOrder apiOrder)
        {
            db.Orders.Add(Mapper.Map <ApiOrder, Order>(apiOrder));
            apiOrder.OrderID = db.SaveChanges();

            return(apiOrder);
        }
Exemplo n.º 6
0
        public ApiComment Add(ApiComment apiComment)
        {
            db.Comments.Add(Mapper.Map <ApiComment, Comment>(apiComment));
            db.SaveChanges();

            return(apiComment);
        }
Exemplo n.º 7
0
        public ApiProducer Add(ApiProducer apiProducer)
        {
            db.Producers.Add(Mapper.Map <ApiProducer, Producer>(apiProducer));
            apiProducer.ProducerID = db.SaveChanges();

            return(apiProducer);
        }
Exemplo n.º 8
0
        public ApiOrderDetail Add(ApiOrderDetail apiOrderDetail)
        {
            db.OrderDetails.Add(Mapper.Map <ApiOrderDetail, OrderDetail>(apiOrderDetail));
            db.SaveChanges();

            return(apiOrderDetail);
        }
Exemplo n.º 9
0
        public ApiUser Add(ApiUser apiUser)
        {
            var user = Mapper.Map <ApiUser, User>(apiUser);

            db.Users.Add(user);
            apiUser.f_ID = db.SaveChanges();

            return(apiUser);
        }