public static bool Insert(Application application) { using (var context = Context()) { int id = context.Insert<Application>("Application", application) .AutoMap(x => x.ApplicationId) .ExecuteReturnLastId<int>(); application.ApplicationId = id; return id > 0; } }
public static bool Delete(Application application) { return Delete(application.ApplicationId); }
public static bool Update(Application application) { using (var context = Context()) { return context.Update<Application>("Application", application) .AutoMap(x => x.ApplicationId) .Where("ApplicationId", application.ApplicationId) .Execute() > 0; } }