private async Task <GenderResponse> Retrieve(StaticVault vault, String id) { GenderResponse retrieved = await vault.Gender.Retrieve(id); Console.WriteLine("//// GenderExample.retrieve:"); Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(retrieved)); return(retrieved); }
private async Task <GenderResponse> Create(StaticVault vault) { String name = "example"; GenderResponse created = await vault.Gender.Create(name); Console.WriteLine("//// GenderExample.create:"); Console.WriteLine("/// Name: " + name); Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(created)); return(created); }
public async Task Run() { // Creating a new Gender GenderResponse created = await Create(staticVault); // Retrieving a existent Gender GenderResponse retrieved = await Retrieve(staticVault, created.Id); await RetrieveFromRealData(staticVault, created.Gender); // Deleting a existent Gender await Delete(staticVault, retrieved.Id); }
public List <GenderResponse> GetAllGenders() { List <Genders> genders = dbContext.Genders.ToList(); List <GenderResponse> responses = new List <GenderResponse>(); foreach (Genders g in genders) { GenderResponse response = new GenderResponse(); response.GenderId = g.GenderId; response.Name = g.Name; responses.Add(response); } return(responses); }
public async Task Run() { var sdk = new Nullafi.NullafiSDK(Environment.GetEnvironmentVariable("API_KEY")); var client = await sdk.CreateClient(); var staticVault = await client.CreateStaticVault("Address Vault Example", null); GenderResponse created = await Create(staticVault); GenderResponse retrieved = await Retrieve(staticVault, created.Id); await RetrieveFromRealData(staticVault, created.Gender); await Delete(staticVault, retrieved.Id); Assert.AreEqual(created.Id, retrieved.Id); Assert.AreEqual(created.Gender, retrieved.Gender); Assert.AreEqual(created.GenderAlias, retrieved.GenderAlias); await client.DeleteStaticVault(staticVault.VaultId); }
public async Task <GenderResponse> GetAllGender() { GenderResponse response = new GenderResponse(); try { var query = await iGender.GetAllGender(); response.ListGender = (from q in query select new GenderViewModel { GenderId = q.GenderId, Name = q.Name }).ToList(); } catch (Exception ex) { response.IsSuccess = false; response.Message = "Something Error in Our System : " + ex.Message; } return(response); }