10using System.Threading.Tasks;
19 public class AsyncController : System.Web.Mvc.AsyncController
30 protected async Task<bool> SaveObjectAsync<T>(T item,
bool forceUpdate) where T :
class,
Csla.
Core.
ISavable
32 return await SaveObjectAsync(item,
47 protected virtual async Task<bool> SaveObjectAsync<T>(T item, Action<T> updateModel,
bool forceUpdate) where T :
class,
Csla.
Core.
ISavable
51 ViewData.Model = item;
52 if (updateModel !=
null)
54 ViewData.Model = await item.SaveAsync(forceUpdate);
59 if (ex.BusinessException !=
null)
60 ModelState.AddModelError(
"", ex.BusinessException.Message);
62 ModelState.AddModelError(
"", ex.Message);
67 ModelState.AddModelError(
"", ex.Message);
93 protected void LoadProperty<P>(
object obj, PropertyInfo<P> propertyInfo, P newValue)
95 new ObjectManager().LoadProperty(obj, propertyInfo, newValue);
98 private class ObjectManager :
Csla.Server.ObjectFactory
100 public new void LoadProperty<P>(
object obj, PropertyInfo<P> propertyInfo, P newValue)
102 base.LoadProperty(obj, propertyInfo, newValue);
This exception is returned for any errors occurring during the server-side DataPortal invocation.
Specifies that the object can save itself.