public void UpdatePriceTags(int id, string priceTag) { var mip = Dao.Single <MenuItemPriceDefinition>(x => x.Id == id); if (mip.PriceTag != priceTag) { using (var workspace = WorkspaceFactory.Create()) { workspace.All <MenuItemPrice>(x => x.PriceTag == mip.PriceTag) .ToList() .ForEach(x => x.PriceTag = priceTag); workspace.CommitChanges(); } } }
public void SaveOrUpdateVehicle(Vehicle vehicle) { if (vehicle.Id <= 0) { using (var wr = WorkspaceFactory.CreateReadOnly()) { if (wr.Single <Vehicle>(x => x.PlateNo == vehicle.PlateNo) != null) { throw new Exception("Vehicle name already exists"); } } } SaveOrUpdateEntity <Vehicle>(vehicle); }
private void Context_AuthenticateRequest(object sender, EventArgs e) { HttpApplication app = (HttpApplication)sender; if (app.Context.User != null && app.Context.User.Identity.IsAuthenticated) { int userId = Int32.Parse(app.Context.User.Identity.Name); using (var wr = WorkspaceFactory.CreateReadOnly()) { AppUser user = wr.Single <AppUser>(x => x.Id == userId, x => x.EmployeePosition, x => x.AppUserRoles.Select(y => y.Role)); user.IsAuthenticated = true; app.Context.User = new ChaiPrincipal(user); } } }
public void OpenTicket(int ticketId) { Debug.Assert(_workspace == null); Debug.Assert(Ticket == null); _workspace = WorkspaceFactory.Create(); if (LocalSettings.DatabaseLabel == "CE") { Ticket = _workspace.Single <Ticket>(ticket => ticket.Id == ticketId); } else { Ticket = _workspace.Single <Ticket>(ticket => ticket.Id == ticketId, x => x.TicketItems.Select(y => y.Properties), x => x.Payments, x => x.Discounts, x => x.TaxServices); } }
public IList <LiquidationReport> GetLiquidationReporto(string DateFrom, string DateTo) { string filterExpression = ""; filterExpression = " SELECT ExpenseLiquidationRequests.RequestDate as Date,TravelAdvanceRequests.TravelAdvanceNo as Travel_ID , ItemAccounts.AccountName as Description,ItemAccounts.AccountCode,Projects.ProjectCode as Project_ID,Grants.GrantCode as Grant_ID " + " From [WorkflowManagment].[dbo].TravelAdvanceRequests " + " Inner join ExpenseLiquidationRequests on TravelAdvanceRequests.Id = ExpenseLiquidationRequests.TravelAdvanceRequest_Id " + " Inner join TravelAdvanceRequestDetails on TravelAdvanceRequests.Id = TravelAdvanceRequestDetails.TravelAdvanceRequest_Id " + " Inner join TravelAdvanceCosts on TravelAdvanceRequestDetails.Id = TravelAdvanceCosts.TravelAdvanceRequestDetail_Id " + " Inner Join ItemAccounts on ItemAccounts.Id= TravelAdvanceCosts.ItemAccount_Id " + " Inner join Projects on Projects.Id = TravelAdvanceRequests.Project_Id " + " Inner join Grants on Grants.Id = TravelAdvanceRequests.Grant_Id " + " where ExpenseLiquidationRequests.ProgressStatus = 'Completed' AND " + " 1 = Case when '" + DateFrom + "' = '' and '" + DateTo + "' ='' Then 1 When ExpenseLiquidationRequests.RequestDate between '" + DateFrom + "' and '" + DateTo + "' Then 1 END "; return(WorkspaceFactory.CreateReadOnly().Queryable <LiquidationReport>(filterExpression).ToList()); }
public IList <PurchaseReport> GetPurchaseReporto(string DateFrom, string DateTo) { string filterExpression = ""; filterExpression = " SELECT PODate as Date,RequestNo as Purchase_Request_Ref,PoNumber as Purchase_Order, ItemAccounts.AccountCode,ItemAccounts.AccountName as Description,PurchaseOrderDetails.TotalCost,Projects.ProjectCode as Project_ID ,Grants.GrantCode as Grant_ID " + " From [WorkflowManagment].[dbo].PurchaseRequests " + " Inner join PurchaseOrders on PurchaseOrders.Id = PurchaseRequests.Id " + " Inner join PurchaseRequestDetails on PurchaseRequestDetails.PurchaseRequest_Id = PurchaseRequests.Id " + " Inner Join PurchaseOrderDetails on PurchaseOrderDetails.PurchaseOrder_Id = PurchaseOrders.Id " + " Inner Join ItemAccounts on ItemAccounts.Id = PurchaseOrderDetails.ItemAccount_Id " + " Inner Join Projects on Projects.Id = PurchaseRequestDetails.Project_Id " + " Inner Join Grants on Grants.Id = PurchaseRequestDetails.Grant_Id " + " where PurchaseRequests.ProgressStatus = 'Completed' AND " + " 1 = Case when '" + DateFrom + "' = '' and '" + DateTo + "' ='' Then 1 When PurchaseOrders.PODate between '" + DateFrom + "' and '" + DateTo + "' Then 1 END "; return(WorkspaceFactory.CreateReadOnly().Queryable <PurchaseReport>(filterExpression).ToList()); }
private TestProjectFileOrAssemblyInfoPropertiesProvider CreateProviderForSourceFileValidation( string code, string propertyName, out Workspace workspace, Lazy <IInterceptingPropertyValueProvider, IInterceptingPropertyValueProviderMetadata> interceptingProvider = null, Dictionary <string, string> additionalProps = null) { var language = code.Contains("[") ? LanguageNames.CSharp : LanguageNames.VisualBasic; workspace = WorkspaceFactory.Create(code, language); var projectFilePath = workspace.CurrentSolution.Projects.First().FilePath; var unconfiguredProject = UnconfiguredProjectFactory.Create(filePath: projectFilePath); var defaultProperties = CreateProjectProperties(additionalProps, saveInProjectFile: false); return(new TestProjectFileOrAssemblyInfoPropertiesProvider(unconfiguredProject, workspace: workspace, defaultProperties: defaultProperties, interceptingProvider: interceptingProvider)); }
public void UpdateEntityData(int entityId, string fieldName, string value) { if (entityId == 0) { return; } using (var w = WorkspaceFactory.Create()) { var entity = w.Single <Entity>(x => x.Id == entityId); if (entity != null) { entity.SetCustomData(fieldName, value); w.CommitChanges(); } } }
public static string GetDataSource(CIMDataConnection dataConnection) { // For more information about CIMDataConnect class and its derived classes, please refer to http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic943.html. if (dataConnection != null) { // DataConnection of Shapefile, Raster, TPK and Feature Layer. if (dataConnection is CIMStandardDataConnection) { WorkspaceFactory factory = (dataConnection as CIMStandardDataConnection).WorkspaceFactory; if (factory == WorkspaceFactory.FeatureService) { // Get url of Feature Layer. return(GetServiceUrl(dataConnection as CIMStandardDataConnection)); } if (factory == WorkspaceFactory.Shapefile || factory == WorkspaceFactory.Raster) { // Get path name of Shapefile or Rater. return(GetStandardDataPathName(dataConnection as CIMStandardDataConnection)); } } // DataConnection of Kml and Kmz. if (dataConnection is CIMKMLDataConnection) { // Get path name of Kml and Kmz. return(GetKMLDataPathName(dataConnection as CIMKMLDataConnection)); } // DataConnection of SPK and SLPK. if (dataConnection is CIMSceneDataConnection) { // Get path name of SPK and SLPK. return(GetSceneDataPathName(dataConnection as CIMSceneDataConnection)); } // DataConnection of Imagary Layer, Map Image Layer, Tile Layer , Scene Layer. if (dataConnection is CIMAGSServiceConnection) { // Get url of Imagary Layer, Map Image Layer, Tile Layer , Scene Layer. return(GetServiceUrl(dataConnection as CIMAGSServiceConnection)); } // DataConnection of WMS if (dataConnection is CIMWMSServiceConnection) { // Get url of WMS. return(GetWmsUrl(dataConnection as CIMWMSServiceConnection)); } } return(null); }
/// <summary> /// Try to authenticate the user. /// </summary> /// <param name="username"></param> /// <param name="password"></param> /// <returns></returns> public bool AuthenticateUser(string username, string password, bool persistLogin) { string hashedPassword = Encryption.StringToMD5Hash(password); try { using (var wr = WorkspaceFactory.Create()) { AppUser user = wr.Single <AppUser>(x => x.UserName == username && x.Password == hashedPassword); if (user != null) { if (!user.IsActive) { throw new Exception("The account is disabled."); } // Added by ZaySoe on 14_Jan_2019 for getting UserLocations //user = wr.Single<AppUser>(x => x.Id == user.Id, x => x.AppUserRoles.Select(y => y.Role), x => x.UserLocations, x => x.UserLocations.Select(p => p.province), x => x.UserLocations.Select(d => d.District), x => x.UserLocations.Select(l => l.LLG), x => x.UserLocations.Select(f => f.Facility), x => x.UserLocations.Select(l => l.Laboratory)); //user = wr.Single<AppUser>(x => x.Id == user.Id, x => x.AppUserRoles.Select(y => y.Role), x => x.UserLocations, x => x.UserLocations.Select(p => p.province), x => x.UserLocations.Select(d => d.District), x => x.UserLocations.Select(l => l.LLG), x => x.UserLocations.Select(f => f.Facility)); user = wr.Single <AppUser>(x => x.Id == user.Id, x => x.AppUserRoles.Select(y => y.Role)); //if(user.AppUserRoles != null && user.AppUserRoles[0].Role.Id == 14) // Lab Role // user = wr.Single<AppUser>(x => x.Id == user.Id, x => x.AppUserRoles.Select(y => y.Role), x => x.UserLocations.Select(y => y.LabCode)); //else if (user.AppUserRoles != null && user.AppUserRoles[0].Role.Id == 13) // Facility Role // user = wr.Single<AppUser>(x => x.Id == user.Id, x => x.AppUserRoles.Select(y => y.Role), x => x.UserLocations, x => x.UserLocations.Select(p => p.province), x => x.UserLocations.Select(d => d.District), x => x.UserLocations.Select(l => l.LLG), x => x.UserLocations.Select(f => f.Facility)); user.IsAuthenticated = true; string currentIp = HttpContext.Current.Request.UserHostAddress; user.LastLogin = DateTime.Now; user.LastIp = currentIp; wr.CommitChanges(); HttpContext.Current.User = new ChaiPrincipal(user); FormsAuthentication.SetAuthCookie(user.Name, persistLogin); return(true); } } } catch (Exception ex) { throw new Exception(String.Format("Unable to log in user '{0}': " + ex.Message, username), ex); } return(false); }
public override GetStatusResponse Start() { var objWsItem = WorkspaceFactory.Get().Get(Request.ItemID); if (objWsItem != null && objWsItem.Project != null) { if (objWsItem.UpdateNew(new VideoInfoProvider().Get(Path.Combine(Settings.NewDirectory, Request.ProjectSourceName)))) { return(new GetStatusResponse(Request, new List <Data.WorkspaceItem>() { objWsItem.GetWorkspaceItem() })); } return(new GetStatusResponse(Request, new ResponseStatus(ResponseState.Error, "File not found"))); } return(new GetStatusResponse(Request, new ResponseStatus(ResponseState.Error, "Project not found"))); }
public int GetNextNumber(int numeratorId) { using (var workspace = WorkspaceFactory.Create()) { var numerator = workspace.Single <Numerator>(x => x.Id == numeratorId); numerator.Number++; try { workspace.CommitChanges(); } catch (DbUpdateConcurrencyException) { return(GetNextNumber(numeratorId)); } return(numerator.Number); } }
public override void Process(ActionData actionData) { if (this._applicationState.IsLocked) { this._methodQueue.Queue("ChangeDatabaseConnection", () => this.Process(actionData)); return; } string asString = actionData.GetAsString("ConnectionString"); WorkspaceFactory.UpdateConnection(asString); EventServiceFactory.EventService.PublishEvent <EventAggregator>("Reset Cache", true); if (actionData.GetAsBoolean("SaveToLocalSettings", false)) { LocalSettings.ConnectionString = asString; LocalSettings.SaveSettings(); } }
public IList <LeaveReport> GetLeaveReporto(string DateFrom, string DateTo) { string filterExpression = ""; filterExpression = " SELECT AppUsers.FirstName + ' ' + AppUsers.LastName as StaffName, " + " [Forward] as Leave_Days_Opening_Balance, " + " LeaveTypes.LeaveTypeName as Leave_Type, " + " CAST(LeaveRequests.DateFrom as nvarchar) + ' ' + CAST(LeaveRequests.DateTo as nvarchar) as Period_Leave_Taken, " + " RequestedDays as Number_of_Leave_Taken , " + " [Balance] as Leave_Balance_Carried_Forward " + " FROM [WorkflowManagment].[dbo].[LeaveRequests] Inner join AppUsers on AppUsers.Id = [LeaveRequests].Requester " + " Inner Join LeaveTypes on LeaveTypes.Id = [LeaveRequests].LeaveType_Id " + " where 1 = Case when '" + DateFrom + "' = '' and '" + DateTo + "' ='' Then 1 When LeaveRequests.RequestedDate between '" + DateFrom + "' and '" + DateTo + "' Then 1 END AND " + " [LeaveRequests].ProgressStatus = 'Completed' "; return(WorkspaceFactory.CreateReadOnly().Queryable <LeaveReport>(filterExpression).ToList()); }
public TestProjectFileOrAssemblyInfoPropertiesProvider( UnconfiguredProject unconfiguredProject = null, Lazy <IInterceptingPropertyValueProvider, IInterceptingPropertyValueProviderMetadata> interceptingProvider = null, Workspace workspace = null, IProjectThreadingService threadingService = null, IProjectProperties defaultProperties = null, IProjectInstancePropertiesProvider instanceProvider = null, Func <ProjectId> getActiveProjectId = null) : this(workspace ?? WorkspaceFactory.Create(""), unconfiguredProject : unconfiguredProject ?? UnconfiguredProjectFactory.Create(), interceptingProvider : interceptingProvider, threadingService : threadingService, defaultProperties : defaultProperties, instanceProvider : instanceProvider, getActiveProjectId : getActiveProjectId) { }
private static IWorkspace PrepareMenu(string fileName) { var pth = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); pth = Path.Combine(pth, "..\\..\\..\\Samba.Presentation"); LocalSettings.AppPath = pth; if (File.Exists(fileName)) { File.Delete(fileName); } WorkspaceFactory.SetDefaultConnectionString(fileName); var dataCreationService = new DataCreationService(); dataCreationService.CreateData(); var workspace = WorkspaceFactory.Create(); return(workspace); }
private static EntityType CreateEntityType(string item, IEnumerable <EntityType> entityTypes) { var entityTypeName = item.Trim('#', ' '); var entityType = entityTypes.SingleOrDefault(x => x.Name.ToLower() == entityTypeName.ToLower()); if (entityType == null) { using (var w = WorkspaceFactory.Create()) { entityType = new EntityType { Name = entityTypeName }; w.Add(entityType); w.CommitChanges(); } } return(entityType); }
public async Task Run_starts_the_kestrel_server_and_provides_a_WebServer_feature_that_can_receive_requests() { var(server, package) = await GetRunnerAndWorkspace(); var workspace = WorkspaceFactory.CreateWorkspaceFromDirectory(package.Directory, package.Name); using (var runResult = await server.Run(new WorkspaceRequest(workspace, "Program.cs"))) { var webServer = runResult.GetFeature <WebServer>(); var response = await webServer.SendAsync(new HttpRequestMessage(HttpMethod.Get, "/api/values")).CancelIfExceeds(new TimeBudget(35.Seconds())); var result = await response.EnsureSuccess() .DeserializeAs <string[]>(); result.Should().Equal("value1", "value2"); } }
protected override void OnSave(string value) { if (Model.Id > 0) { var mip = Dao.Single <MenuItemPriceDefinition>(x => x.Id == Model.Id); if (mip.PriceTag != Model.PriceTag) { using (var workspace = WorkspaceFactory.Create()) { workspace.All <MenuItemPrice>(x => x.PriceTag == mip.PriceTag) .ToList() .ForEach(x => x.PriceTag = Model.PriceTag); workspace.CommitChanges(); } } } base.OnSave(value); }
public void SaveFreeOrderTag(int orderTagGroupId, OrderTag orderTag) { using (var v = WorkspaceFactory.Create()) { var og = v.Single <OrderTagGroup>(x => x.Id == orderTagGroupId); if (og != null) { var lvTagName = orderTag.Name.ToLower(); var t = v.Single <OrderTag>(x => x.Name.ToLower() == lvTagName); if (t == null) { var ot = new OrderTag(); ot.InjectFrom <CloneInjection>(orderTag); og.OrderTags.Add(ot); v.CommitChanges(); } } } }
public void UpdateResourceState(int resourceId, int stateId) { if (resourceId == 0) { return; } using (var w = WorkspaceFactory.Create()) { var csid = w.Last <ResourceStateValue>(x => x.ResoruceId == resourceId); if (csid == null || csid.StateId != stateId) { var v = new ResourceStateValue { ResoruceId = resourceId, Date = DateTime.Now, StateId = stateId }; w.Add(v); w.CommitChanges(); } } }
public Dictionary <AccountType, BalanceValue> GetAccountTypeBalances(IList <int> accountTypeIds, Expression <Func <AccountTransactionValue, bool> > filter) { using (var w = WorkspaceFactory.CreateReadOnly()) { Expression <Func <AccountTransactionValue, bool> > func = x => accountTypeIds.Contains(x.AccountTypeId); if (filter != null) { func = func.And(filter); } var transactionValues = w.Queryable <AccountTransactionValue>() .Where(func) .GroupBy(x => x.AccountTypeId) .Select(x => new { Id = x.Key, Amount = x.Sum(y => y.Debit - y.Credit), Exchange = x.Sum(y => y.Exchange) }) .ToDictionary(x => x.Id, x => new BalanceValue { Balance = x.Amount, Exchange = x.Exchange }); return(w.Queryable <AccountType>().Where(x => accountTypeIds.Contains(x.Id)).ToDictionary(x => x, x => transactionValues.ContainsKey(x.Id) ? transactionValues[x.Id] : BalanceValue.Empty)); } }
public void UpdateAccountOfOpenTickets(Entity entity) { var openTicketDataList = GetOpenTickets(entity.Id).Select(x => x.Id); using (var w = WorkspaceFactory.Create()) { var tickets = w.All <Ticket>(x => openTicketDataList.Contains(x.Id), x => x.TicketEntities); foreach (var ticket in tickets) { ticket.TicketEntities.Where(x => x.EntityId == entity.Id).ToList().ForEach(x => { var entityType = _cacheService.GetEntityTypeById(x.EntityTypeId); x.AccountTypeId = entityType.AccountTypeId; x.AccountId = entity.AccountId; }); } w.CommitChanges(); } }
public IEnumerable <Account> BatchCreateAccounts(string[] values, IWorkspace workspace) { IList <Account> result = new List <Account>(); if (values.Length > 0) { var templates = workspace.All <AccountType>().ToList(); AccountType currentTemplate = null; foreach (var item in values) { if (item.StartsWith("#")) { var templateName = item.Trim('#', ' '); currentTemplate = templates.SingleOrDefault(x => x.Name.ToLower() == templateName.ToLower()); if (currentTemplate == null) { using (var w = WorkspaceFactory.Create()) { currentTemplate = new AccountType { Name = templateName }; w.Add(currentTemplate); w.CommitChanges(); } } } else if (currentTemplate != null) { var accountName = item.ToLower().Trim(); if (workspace.Single <Account>(x => x.Name.ToLower() == accountName) == null) { var account = new Account { Name = item, AccountTypeId = currentTemplate.Id }; result.Add(account); } } } } return(result); }
/// <summary> /// Try to authenticate the user. /// </summary> /// <param name="username"></param> /// <param name="password"></param> /// <returns></returns> public bool AuthenticateUser(string username, string password, bool persistLogin) { string hashedPassword = Encryption.StringToMD5Hash(password); try { using (var wr = WorkspaceFactory.Create()) { AppUser user = wr.Single <AppUser>(x => x.UserName == username && x.Password == hashedPassword, x => x.EmployeePosition); if (user != null) { if (!user.IsActive) { throw new Exception("The account is disabled."); } user.IsAuthenticated = true; string currentIp = HttpContext.Current.Request.UserHostAddress; user.LastLogin = DateTime.Now; user.LastIp = currentIp; wr.CommitChanges(); HttpContext.Current.User = new ChaiPrincipal(user); FormsAuthentication.SetAuthCookie(user.Name, persistLogin); return(true); } else { _failedAttempts++; if (_failedAttempts == 3) { LogInFailureLog.Warn("User with username: "******" IP " + HttpContext.Current.Request.UserHostAddress + " has failed a log in attempt!"); } } } } catch (Exception ex) { throw new Exception(String.Format("Unable to log in user '{0}': " + ex.Message, username), ex.InnerException); } return(false); }
private static void OnCronTrigger(CronObject cronobject) { using (var workspace = WorkspaceFactory.Create()) { var trigger = workspace.Single <Trigger>(x => x.Id == ((Trigger)cronobject.Object).Id); if (trigger != null) { trigger.LastTrigger = DateTime.Now; workspace.CommitChanges(); if (AppServices.ActiveAppScreen != AppScreens.Dashboard) { RuleExecutor.NotifyEvent(RuleEventNames.TriggerExecuted, new { TriggerName = trigger.Name }); } } else { cronobject.Stop(); } } }
public void UpdateEntityState(int entityId, string stateName, string state) { if (entityId == 0) { return; } using (var w = WorkspaceFactory.Create()) { var stateValue = w.Single <EntityStateValue>(x => x.EntityId == entityId); if (stateValue == null) { stateValue = new EntityStateValue { EntityId = entityId }; w.Add(stateValue); } stateValue.SetStateValue(stateName, state); w.CommitChanges(); } }
public int CreateAccount(int accountTypeId, string accountName) { if (accountTypeId == 0 || string.IsNullOrEmpty(accountName)) { return(0); } if (Dao.Exists <Account>(x => x.Name == accountName)) { return(0); } using (var w = WorkspaceFactory.Create()) { var account = new Account { AccountTypeId = accountTypeId, Name = accountName }; w.Add(account); w.CommitChanges(); return(account.Id); } }
public async Task Run_starts_the_kestrel_server_and_provides_a_WebServer_feature_that_can_receive_requests() { var registry = Default.PackageFinder; var server = new RoslynWorkspaceServer(registry); var package = await registry.Get <IHaveADirectory>("aspnet.webapi"); var workspace = WorkspaceFactory.CreateWorkspaceFromDirectory(package.Directory, "aspnet.webapi"); using (var runResult = await server.Run(new WorkspaceRequest(workspace, "Program.cs"))) { var webServer = runResult.GetFeature <WebServer>(); var response = await webServer.SendAsync(new HttpRequestMessage(HttpMethod.Get, "/api/values")).CancelIfExceeds(new TimeBudget(35.Seconds())); var result = await response.EnsureSuccess() .DeserializeAs <string[]>(); result.Should().Equal("value1", "value2"); } }
private void OnCronTrigger(object sender, CronEventArgs e) { using (var workspace = WorkspaceFactory.Create()) { var trigger = workspace.Single <Trigger>(x => x.Id == ((Trigger)e.CronObject.Object).Id); if (trigger != null) { trigger.LastTrigger = DateTime.Now; workspace.CommitChanges(); if (_applicationState.ActiveAppScreen != AppScreens.Dashboard) { _automationService.NotifyEvent(RuleEventNames.TriggerExecuted, new { TriggerName = trigger.Name }); } } else { e.CronObject.Stop(); } } }
public LoggingWorkspaceDescriptor(WorkspaceFactory workspaceFactory) { _workspaceFactory = workspaceFactory; }
public FSharpReplWorkspaceDescriptor(WorkspaceFactory workspaceFactory) { _workspaceFactory = workspaceFactory; }
public void Serializable() { this.SaveApplication(); try { var workspaceFactory = new WorkspaceFactory(); Config.Default = new Databases.Object.SqlClient.Database(new Databases.Object.SqlClient.Configuration { ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["allors"].ConnectionString, ObjectFactory = Config.ObjectFactory, WorkspaceFactory = workspaceFactory }); Config.Serializable = new Databases.Object.SqlClient.Database(new Databases.Object.SqlClient.Configuration { ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["allors"].ConnectionString, ObjectFactory = Config.ObjectFactory, WorkspaceFactory = workspaceFactory, IsolationLevel = IsolationLevel.Serializable }); this.Init(true); var id = Guid.NewGuid(); new CounterBuilder(DatabaseSession).WithUniqueId(id).Build(); this.DatabaseSession.Derive(true); this.DatabaseSession.Commit(); Assert.AreEqual(1, Counters.NextValue(this.DatabaseSession, id)); Assert.AreEqual(2, Counters.NextValue(this.DatabaseSession, id)); Assert.AreEqual(3, Counters.NextValue(this.DatabaseSession, id)); Assert.AreEqual(4, Counters.NextValue(this.DatabaseSession, id)); } finally { this.RestoreApplication(); } }
public ExampleWorkspaceDescriptor(WorkspaceFactory workspaceFactory) { _workspaceFactory = workspaceFactory; }
public WeatherWorkspaceDescriptor(WorkspaceFactory workspaceFactory) { _workspaceFactory = workspaceFactory; }
public DilbertWorkspaceDescriptor(WorkspaceFactory workspaceFactory) { _workspaceFactory = workspaceFactory; }