public async Task <ActionResult> OnPost() { if (ModelState.IsValid) { var materialSeriesToAdd = new MaterialSeriesModel() { ShortName = ShortName, Description = Description, Type = Type }; await MaterialSeriesDataAcces.CreateMaterialSeries(materialSeriesToAdd); Message = new PopUpMessageModel() { Text = "Material Series created successfully", IsMessageGood = true }; await SetUpProperties(); return(Page()); } else { await SetUpProperties(); return(Page()); } }
public async Task SetUpProperties() { var tempMaterialList = await MaterialSeriesDataAcces.GetAllMaterialSeries(); if (tempMaterialList != null) { AllMaterialSeries = tempMaterialList.ToList(); } else { AllMaterialSeries = new List <MaterialSeriesModel>(); } }