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();
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
        public string AddUser(User user, CancellationToken token)
        {
            DataValidator <ArgumentNullException> .Validate <User>(user);

            return(InMemoryProfileStore.AddUser(user, token));
        }