https://github.com/nikitaignatov/x-editable-net
Basic implementation of inline edit API written in .Net using EF
https://github.com/nikitaignatov/x-editable-net
entity-framework inline-editing x-editable
Last synced: about 1 year ago
JSON representation
Basic implementation of inline edit API written in .Net using EF
- Host: GitHub
- URL: https://github.com/nikitaignatov/x-editable-net
- Owner: nikitaignatov
- Created: 2016-04-12T17:06:31.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-27T22:23:22.000Z (about 10 years ago)
- Last Synced: 2025-01-31T09:44:39.076Z (over 1 year ago)
- Topics: entity-framework, inline-editing, x-editable
- Language: C#
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# x-editable-net
This library supports [x-editable](https://github.com/vitalets/x-editable) updates with EntityFramework.
````csharp
public class DefaultRequest
{
public int pk { get; set; }
public string name { get; set; }
public string value { get; set; }
public string entity { get; set; }
}
````
Api endpoint for handling the updates, int the the primary key type.
````csharp
[HttpPatch]
public dynamic InlineEdit([FromBody]DefaultRequest request)
{
try
{
var command = new UpdateEntityCommand(request.pk, request.value, request.name, exportedTypes[request.entity]);
handler.Handle(command);
return Ok();
}
catch (Exception ex)
{
return BadRequest($"Failed due to {JsonConvert.SerializeObject(ex, Formatting.Indented)}");
}
}
````