public EntityFile Generate(IEntityType entity) { var template = new CreateEdit(); template.Action = this.Action; template.EntityName = entity.ClrType.Name; template.EntityIdName = entity.GetKeys().First().Properties.First().Name; template.ColumnNames = entity.GetProperties() .OrderByUserExperience(entity) .Select(p => { if (entity.GetForeignKeys().Select(k => k.Properties[0].Name).Contains(p.Name)) { return(p.Name + CreateEdit.IDENTIFIER_FK); } else if (p.IsInternalFor(entity)) { return(p.Name + CreateEdit.IDENTIFIER_HIDDEN); } else if (p.ClrType == typeof(DateTime)) { return(p.Name + CreateEdit.IDENTIFIER_DATETIME); } else { return(p.Name); } }) .ToList(); return(new EntityFile() { data = template.TransformText(), path = $"Views/Generated/{entity.ClrType.Name}/{this.Action}.cshtml" }); }
private void btnEditAtricle_Click(object sender, EventArgs e) { CreateEdit formEdit = new CreateEdit(new User()); formEdit.ShowDialog(); }
public async Task<ActionResult> Edit(CreateEdit.Command command) { await _mediator.SendAsync(command); return this.RedirectToActionJson("Index"); }
private void btnEditUser_Click(object sender, EventArgs e) { CreateEdit formEdit = new CreateEdit(current); formEdit.ShowDialog(); }
public async Task<ActionResult> Edit(CreateEdit.Query query) { var model = await _mediator.SendAsync(query); return View("CreateEdit", model); }