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