public IEnumerable <Product> Get() { IEnumerable <Product> objReturn = null; using (Product_BAL obj_BAL = new Product_BAL()) { objReturn = obj_BAL.GetAllRecord(); } return(objReturn); }
public DefaultResult Post([FromBody] Product objProduct) { DefaultResult objReturn = new DefaultResult(); if (objProduct.Id == 0) { objProduct.ProductId = Guid.NewGuid(); objProduct.CreationDate = DateTime.UtcNow.AddHours(5).AddMinutes(30); objProduct.IsActive = true; //objProduct.PasswordHash = EncryptionLibrary.EncryptText(objProduct.PasswordHash); } objProduct.UpdatedDate = DateTime.UtcNow.AddHours(5).AddMinutes(30); objProduct.IsDeleted = false; using (Product_BAL objBAL = new Product_BAL()) { objReturn.Data = objBAL.InsertUpdateRecord(objProduct).ToString(); } return(objReturn); }