本文整理汇总了C#中System.Web.Http.OData.Delta类的典型用法代码示例。如果您正苦于以下问题:C# Delta类的具体用法?C# Delta怎么用?C# Delta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Delta类属于System.Web.Http.OData命名空间,在下文中一共展示了Delta类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Patch
public IHttpActionResult Patch([FromODataUri] string key, Delta<Ingredient> patch)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Ingredient ingredient = db.Ingredients.Find(key);
if (ingredient == null)
{
return NotFound();
}
patch.Patch(ingredient);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!IngredientExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(ingredient);
}
开发者ID:pedroCosta87,项目名称:PocketKitchen,代码行数:33,代码来源:IngredientsController.cs
示例2: Put
// PUT: odata/Basic_Information1(5)
public async Task<IHttpActionResult> Put([FromODataUri] int key, Delta<Basic_Information> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Basic_Information basic_Information = await db.Basic_Information.FindAsync(key);
if (basic_Information == null)
{
return NotFound();
}
patch.Put(basic_Information);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!Basic_InformationExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(basic_Information);
}
开发者ID:zahid492,项目名称:Angular-JS-Web-API,代码行数:36,代码来源:Basic_Information1Controller.cs
示例3: Put
// PUT: odata/OrganizationIdentityDirectory(5)
public async Task<IHttpActionResult> Put([FromODataUri] int key, Delta<OrganizationIdentityDirectory> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
OrganizationIdentityDirectory organizationIdentityDirectory = await db.OrganizationIdentityDirectory.FindAsync(key);
if (organizationIdentityDirectory == null)
{
return NotFound();
}
patch.Put(organizationIdentityDirectory);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!OrganizationIdentityDirectoryExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(organizationIdentityDirectory);
}
开发者ID:rafathan,项目名称:orbitstore,代码行数:36,代码来源:OrganizationIdentityDirectoryController.cs
示例4: Put
// PUT: odata/IdentityBinderLinkHistory(5)
public async Task<IHttpActionResult> Put([FromODataUri] long key, Delta<IdentityBinderLinkHistory> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
IdentityBinderLinkHistory identityBinderLinkHistory = await db.IdentityBinderLinkHistory.FindAsync(key);
if (identityBinderLinkHistory == null)
{
return NotFound();
}
patch.Put(identityBinderLinkHistory);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!IdentityBinderLinkHistoryExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(identityBinderLinkHistory);
}
开发者ID:rafathan,项目名称:orbitstore,代码行数:36,代码来源:IdentityBinderLinkHistoryController.cs
示例5: Patch
public IHttpActionResult Patch([FromODataUri] string key, Delta<Customer> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Customer customer = db.Customers.Find(key);
if (customer == null)
{
return NotFound();
}
patch.Patch(customer);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!CustomerExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(customer);
}
开发者ID:atiqShafi,项目名称:CrudODataKendoGrid,代码行数:35,代码来源:ODataCustomersController.cs
示例6: Patch
public IHttpActionResult Patch([FromODataUri] long key, Delta<Employee> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Employee employee = db.Employees.Find(key);
if (employee == null)
{
return NotFound();
}
patch.Patch(employee);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!EmployeeExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(employee);
}
开发者ID:aukgit,项目名称:jquery-server-combo,代码行数:35,代码来源:EmployeesController.cs
示例7: Patch
public IHttpActionResult Patch([FromODataUri] string key, Delta<AspNetUserLogin> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
AspNetUserLogin aspNetUserLogin = db.AspNetUserLogins.Find(key);
if (aspNetUserLogin == null)
{
return NotFound();
}
patch.Patch(aspNetUserLogin);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!AspNetUserLoginExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(aspNetUserLogin);
}
开发者ID:GeraldBecker,项目名称:WindowsDefender,代码行数:35,代码来源:ODAspNetUserLoginsController.cs
示例8: Patch
public IHttpActionResult Patch([FromODataUri] int key, Delta<Order> patch)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Order order = db.Orders.Find(key);
if (order == null)
{
return NotFound();
}
patch.Patch(order);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!OrderExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(order);
}
开发者ID:nickgoodrow,项目名称:ODataSamples,代码行数:33,代码来源:OrdersController.cs
示例9: Patch
public IHttpActionResult Patch([FromODataUri] int key, Delta<MatchHistoryDetail> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
MatchHistoryDetail matchHistoryDetail = db.MatchHistoryDetails.Find(key);
if (matchHistoryDetail == null)
{
return NotFound();
}
patch.Patch(matchHistoryDetail);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!MatchHistoryDetailExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(matchHistoryDetail);
}
开发者ID:GeraldBecker,项目名称:WindowsDefender,代码行数:35,代码来源:ODMatchHistoryDetailsController.cs
示例10: Patch
public async Task<IHttpActionResult> Patch([FromODataUri] int key, Delta<Report> patch)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Report report = await db.Reports.FindAsync(key);
if (report == null)
{
return NotFound();
}
patch.Patch(report);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!ReportExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(report);
}
开发者ID:fathurxzz,项目名称:aleqx,代码行数:33,代码来源:ReportsController.cs
示例11: Patch
public IHttpActionResult Patch([FromODataUri] int key, Delta<Login> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Login login = db.LoginSet.Find(key);
if (login == null)
{
return NotFound();
}
patch.Patch(login);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!LoginExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(login);
}
开发者ID:ulrich1966,项目名称:PlayHouse,代码行数:35,代码来源:LoginsController.cs
示例12: Put
// PUT: odata/Parking(5)
public async Task<IHttpActionResult> Put([FromODataUri] long key, Delta<Parking> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Parking parking = await db.Parkings.FindAsync(key);
if (parking == null)
{
return NotFound();
}
patch.Put(parking);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!ParkingExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(parking);
}
开发者ID:bhubanmm,项目名称:PMS,代码行数:36,代码来源:ParkingController.cs
示例13: Put
// PUT: odata/BOOKs(5)
public IHttpActionResult Put([FromODataUri] int key, Delta<BOOK> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
BOOK bOOK = db.BOOKS.Find(key);
if (bOOK == null)
{
return NotFound();
}
patch.Put(bOOK);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!BOOKExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(bOOK);
}
开发者ID:Speedyjet,项目名称:FinalLibrary,代码行数:36,代码来源:BOOKsController.cs
示例14: Patch
public IHttpActionResult Patch([FromODataUri] string key, Delta<Friend> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Friend friend = db.Friends.Find(key);
if (friend == null)
{
return NotFound();
}
patch.Patch(friend);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!FriendExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(friend);
}
开发者ID:GeraldBecker,项目名称:WindowsDefender,代码行数:35,代码来源:ODFriendsController.cs
示例15: Put
// PUT: odata/RelUserModules(5)
public async Task<IHttpActionResult> Put([FromODataUri] int key, Delta<RelUserModule> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
RelUserModule relUserModule = await db.RelUserModule.FindAsync(key);
if (relUserModule == null)
{
return NotFound();
}
patch.Put(relUserModule);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!RelUserModuleExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(relUserModule);
}
开发者ID:jcvaldes,项目名称:MyRoomV7,代码行数:36,代码来源:RelUserModulesController.cs
示例16: Put
// PUT: odata/FoodDescriptions(5)
public async Task<IHttpActionResult> Put([FromODataUri] string key, Delta<FoodDescription> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
FoodDescription foodDescription = await db.FoodDescriptions.FindAsync(key);
if (foodDescription == null)
{
return NotFound();
}
patch.Put(foodDescription);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!FoodDescriptionExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(foodDescription);
}
开发者ID:grantsneal,项目名称:TelerikNEXT2015,代码行数:36,代码来源:FoodDescriptionsController.cs
示例17: Patch
public async Task<IHttpActionResult> Patch([FromODataUri] int key, Delta<WorkType> patch)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
WorkType worktype = await db.WorkTypes.FindAsync(key);
if (worktype == null)
{
return NotFound();
}
patch.Patch(worktype);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!WorkTypeExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(worktype);
}
开发者ID:fathurxzz,项目名称:aleqx,代码行数:33,代码来源:WorkTypesController.cs
示例18: Patch
public IHttpActionResult Patch([FromODataUri] int key, Delta<Contact> patch)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Contact contact = db.Contacts.Find(key);
if (contact == null)
{
return NotFound();
}
patch.Patch(contact);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!ContactExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(contact);
}
开发者ID:karashak1,项目名称:fallCSharp,代码行数:33,代码来源:ODataContactsController.cs
示例19: Put
// PUT: odata/TauschObjs(5)
public IHttpActionResult Put([FromODataUri] int key, Delta<TauschObj> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
TauschObj tauschObj = db.TauschObjs.Find(key);
if (tauschObj == null)
{
return NotFound();
}
patch.Put(tauschObj);
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!TauschObjExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(tauschObj);
}
开发者ID:NeonPurplelight,项目名称:ASP-Server,代码行数:36,代码来源:TauschObjsController.cs
示例20: Patch
public async Task<IHttpActionResult> Patch([FromODataUri] int key, Delta<TodoList> patch)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
TodoList todolist = await db.TodoLists.FindAsync(key);
if (todolist == null)
{
return NotFound();
}
patch.Patch(todolist);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!TodoListExists(key))
{
return NotFound();
}
throw;
}
return Updated(todolist);
}
开发者ID:Javvar,项目名称:Breeze,代码行数:30,代码来源:TodoListsController.cs
注:本文中的System.Web.Http.OData.Delta类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论