예제 #1
0
        /// <summary>
        /// Add new recipe.
        /// </summary>
        /// <param name="model">Recipe to be added</param>
        /// <returns>Added recipe with correct key(Id) value</returns>
        public async Task <Recipe> AddDataModelAsync(Recipe model)
        {
            model.Id = default;
            var entity = db.Add(model);
            await db.SaveChangesAsync();

            return(entity.Entity);
        }
예제 #2
0
        /// <summary>
        /// Add new transaction.
        /// </summary>
        /// <param name="model">Transaction to be added</param>
        /// <returns>Added transaction with correct key(Id) value</returns>
        public async Task <TransactionBatch> AddDataModelAsync(TransactionBatch model)
        {
            model.Id = default;
            var entity = db.Add(model);
            await db.SaveChangesAsync();

            return(entity.Entity);
        }
예제 #3
0
        /// <summary>
        /// Add new product recipe relation.
        /// </summary>
        /// <param name="model">Product recipe relation to be added</param>
        /// <returns>Added product recipe relation with correct key(ProductId, RecipeId) value</returns>
        public async Task <RecipeProductChanges> AddDataModelAsync(RecipeProductChanges model)
        {
            var entity = db.Add(model);
            await db.SaveChangesAsync();

            return(entity.Entity);
        }
예제 #4
0
        /// <summary>
        /// Add new tech process.
        /// </summary>
        /// <param name="model">Tech process to be added</param>
        /// <returns>Added tech process with correct key(FacilityId, RecipeId) value</returns>
        public async Task <TechProcess> AddDataModelAsync(TechProcess model)
        {
            var entity = db.Add(model);
            await db.SaveChangesAsync();

            return(entity.Entity);
        }
예제 #5
0
        /// <summary>
        /// Add new product to catalog.
        /// </summary>
        /// <param name="model">Product to be added to catalog</param>
        /// <returns>Added product from catalog with correct key(Id) value</returns>
        public async Task <ProductCatalog> AddDataModelAsync(ProductCatalog model)
        {
            model.Id = default;
            var entity = db.Add(model);
            await db.SaveChangesAsync();

            return(entity.Entity);
        }
예제 #6
0
        /// <summary>
        /// Add new operation.
        /// </summary>
        /// <param name="model">Operation to be added</param>
        /// <returns>Added operation with correct key(Id) value</returns>
        public async Task <Operation> AddDataModelAsync(Operation model)
        {
            model.Id = default;
            var entity = db.Add(model);
            await db.SaveChangesAsync();

            return(entity.Entity);
        }