public async Task <ContactAreaModel> getDataContact(int IdArea) { ContactAreaModel model = new ContactAreaModel(); using (var _context = new DataBaseContext()) { object[] parameter = new object[] { IdArea }; var dReader = await _context.ExecuteReaderAsync("sp_GetAreaContact", parameter); while (dReader.Read()) { model.ContactName = dReader.GetString(0); model.Email = dReader.GetString(1); } } return(model); }
public async Task <ContactAreaModel> getDataUser(string username) { ContactAreaModel model = new ContactAreaModel(); using (var _context = new DataBaseContext()) { var strQuery = "EXEC sp_GetDataUser '" + username + "'"; object[] parameter = new object[] { username }; var dReader = await _context.ExecuteReaderAsync("sp_GetDataUser", parameter); while (dReader.Read()) { model.ContactName = dReader.GetString(0); model.Email = dReader.GetString(1); } } return(model); }