static void Main(string[] args) { var token = new System.Threading.CancellationToken(); new PipelinePattern.Services.ProfileService().AddProfile(@"C:\Users\Saran\documents\visual studio 2013\Projects\WinFormApps\PipelinePattern\PipelinePattern\SampleInputs.txt", token); InMemoryProfileStore.HardPersist(); Console.ReadKey(); }
public void AddRoles(string userId, Role[] roles, CancellationToken token) { DataValidator <ArgumentNullException> .Validate <string>(userId); DataValidator <ArgumentNullException> .Validate <Role[]>(roles); if (!token.IsCancellationRequested) { InMemoryProfileStore.AddUserRoles(userId, roles, token); } }
public void AddAddress(string userId, Address[] addresses, CancellationToken token) { DataValidator <ArgumentNullException> .Validate <string>(userId); DataValidator <ArgumentNullException> .Validate <Address[]>(addresses); Parallel.For(0, addresses.Length, (i) => { addresses[i].Id = Guid.NewGuid().ToString(); }); if (!token.IsCancellationRequested) { InMemoryProfileStore.AddUserAddress(userId, addresses, token); } }
public string AddUser(User user, CancellationToken token) { DataValidator <ArgumentNullException> .Validate <User>(user); return(InMemoryProfileStore.AddUser(user, token)); }