Exemplo n.º 1
0
        public async Task <ServiceResult> AddMaterialType(MaterialTypeViewModel entity)
        {
            var id = await materialTypeWriteRepository.AddMaterialType(entity);

            ServiceResult result = new ServiceResult()
            {
                Id = id
            };

            if (id < 0)
            {
                result.SetFailure("Error while inserting material.");
            }
            else
            {
                result.SetSuccess("Material added successfully.");
            }
            return(result);
        }
Exemplo n.º 2
0
 protected virtual async Task <int> AddMaterial(MaterialTypeViewModel entity)
 {
     return(await materialTypeWriteRepository.AddMaterialType(entity));
 }