Exemple #1
0
 public static Task NotifyTeam([ActivityTrigger] ProjectProposalModel proposal,
                               ILogger log)
 {
     /*
      * Notify the team's members
      */
     return(Task.CompletedTask);
 }
Exemple #2
0
 public static Task SendProposalToManager([ActivityTrigger] ProjectProposalModel proposal,
                                          ILogger log)
 {
     /*
      * Send the proposal to the manager
      */
     return(Task.CompletedTask);
 }
Exemple #3
0
 public static Task DenyProposal([ActivityTrigger] ProjectProposalModel proposal,
                                 ILogger log)
 {
     /*
      * Reject the project proposal
      * => notify the proposal creator
      */
     return(Task.CompletedTask);
 }
Exemple #4
0
        public static Task ProcessProjectOrchestration(
            [OrchestrationTrigger] IDurableOrchestrationContext context,
            ILogger log)
        {
            ProjectProposalModel input = context.GetInput <ProjectProposalModel>();

            /*
             * Contain the workflow of the project creation (1 activity per action):
             * Create features + tasks
             * Compute planning
             * Assign tasks
             * Compute charts according to the features/tasks/estimated time...
             */
            return(Task.CompletedTask);
        }
Exemple #5
0
        public static async Task <string> ProcessProposalOrchestration(
            [OrchestrationTrigger] IDurableOrchestrationContext context,
            ILogger log)
        {
            ProjectProposalModel proposal = await context.CallActivityAsync <ProjectProposalModel>("get-project-proposal", context.InstanceId);

            // Send proposal to the manager
            await context.CallActivityAsync("send-proposal", proposal);

            bool approved;

            try
            {
                // Wait for the manager's approval
                // Set a 30 minutes timeout
                approved = await context.WaitForExternalEvent <bool>("ApprovalEvent", new TimeSpan(0, 30, 0));

                log.LogInformation("Wait for manager's response for project '{proposalId}'", proposal.Id);
            }
            catch (TimeoutException)
            {
                // Timeout occured, it means the manager didn't approve/reject the proposal within the 30 minutes => reject the proposal
                approved = false;
            }

            if (!approved)
            {
                // Deny the proposal
                await context.CallActivityAsync("deny-proposal", proposal);

                return("Proposal rejected");
            }

            // Proposal approved
            // => notify the team + create the project in the company's system
            List <Task> parallelTasks = new List <Task>
            {
                context.CallActivityAsync("notify-team", proposal),
                context.CallSubOrchestratorAsync("process-project-orchestration", proposal)
            };
            await Task.WhenAll(parallelTasks);

            return("Proposal accepted and processed");
        }
        //upload files
        public static async Task <ProjectProposalDetail> uploadOtherProposaldoc(string folderName, IFormFile filedata, string fileName, GoogleCredentialModel googleCredential, string EmailId, string logginUserEmailId, string ext, JObject googleCredentialPathFile, string ProposalType)
        {
            ProjectProposalModel res    = new ProjectProposalModel();
            string exten                = Path.GetExtension(fileName).ToLower();
            ProjectProposalDetail model = new ProjectProposalDetail();

            //there are different scopes, which you can find here https://cloud.google.com/storage/docs/authentication
            var scopes = new[] { @"https://www.googleapis.com/auth/cloud-platform" };
            var cts    = new CancellationTokenSource();

            ClientSecrets secrets = new ClientSecrets();

            secrets.ClientId     = googleCredentialPathFile["installed"]["client_id"].ToString();
            secrets.ClientSecret = googleCredentialPathFile["installed"]["client_secret"].ToString();

            UserCredential credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                secrets,
                scopes,
                StaticResource.EmailId, CancellationToken.None);

            // Create the service.
            StorageService service = new StorageService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName       = StaticResource.ApplicationName,
            });

            var bucketsQuery = service.Buckets.List(StaticResource.ProjectId);

            bucketsQuery.OauthToken = credential.Token.AccessToken;
            var buckets = bucketsQuery.Execute();

            FileStream fileStream = null;

            try
            {
                ApiResponse response  = new ApiResponse();
                var         newObject = new Google.Apis.Storage.v1.Data.Object()
                {
                    Bucket = StaticResource.BucketName,
                    Name   = StaticResource.ProjectsFolderName + "/" + folderName + "/" + fileName
                };
                var mimetype = GetMimeType(ext);

                var uploadRequest = new ObjectsResource.InsertMediaUpload(service, newObject, StaticResource.BucketName, filedata.OpenReadStream(), mimetype);
                uploadRequest.OauthToken = credential.Token.AccessToken;
                var fileResponse = uploadRequest.Upload();

                Console.WriteLine($"Other files response from bucket: {fileResponse}");

                var bucketFolderWithFilePath = newObject.Bucket + "/" + newObject.Name;
                if (fileResponse.Status.ToString() == "Completed" && fileResponse.Exception == null)
                {
                    if (ProposalType == "Proposal")
                    {
                        model.FolderName       = folderName;
                        model.ProposalFileName = fileName;
                        model.ProposalWebLink  = bucketFolderWithFilePath;
                        model.IsDeleted        = false;
                        model.CreatedDate      = DateTime.UtcNow;
                    }

                    if (ProposalType == "EOI")
                    {
                        model.FolderName     = folderName;
                        model.EDIFileName    = fileName;
                        model.EDIFileWebLink = bucketFolderWithFilePath;
                        model.EDIFileExtType = ext;
                        model.IsDeleted      = false;
                        model.ModifiedDate   = DateTime.UtcNow;
                    }
                    else if (ProposalType == "BUDGET")
                    {
                        model.FolderName        = folderName;
                        model.IsDeleted         = false;
                        model.BudgetFileName    = fileName;
                        model.BudgetFileWebLink = bucketFolderWithFilePath;
                        model.BudgetFileExtType = ext;
                        model.ModifiedDate      = DateTime.UtcNow;
                    }
                    else if (ProposalType == "CONCEPT")
                    {
                        model.FolderName         = folderName;
                        model.IsDeleted          = false;
                        model.ConceptFileName    = fileName;
                        model.ConceptFileWebLink = bucketFolderWithFilePath;
                        model.ConceptFileExtType = ext;
                        model.ModifiedDate       = DateTime.UtcNow;
                    }
                    else if (ProposalType == "PRESENTATION")
                    {
                        model.FolderName              = folderName;
                        model.IsDeleted               = false;
                        model.PresentationFileName    = fileName;
                        model.PresentationFileWebLink = bucketFolderWithFilePath;
                        model.PresentationExtType     = ext;
                        model.ModifiedDate            = DateTime.UtcNow;
                    }
                }
                else
                {
                    throw new Exception(StaticResource.UnableToUploadFile);
                }


                ////code to delete the file
                //ObjectsResource.ListRequest request = service.Objects.List(googleCredential.BucketName);
                //request.Delimiter = folderName + "/";

                ////request.Prefix = Delimiter;
                //var filePath = folderName + "/" + projectProposalfilename;
                //Google.Apis.Storage.v1.Data.Objects response1 = request.Execute();

                //foreach (var data in response1.Items)
                //{

                //    if (data != null && data.Name == filePath)
                //    {
                //        //delete the file in containing folder******

                //        ObjectsResource.DeleteRequest deleteRequest = null;

                //        deleteRequest = new ObjectsResource.DeleteRequest(service, googleCredential.BucketName, data.Name);
                //        deleteRequest.OauthToken = credential.Token.AccessToken;
                //        deleteRequest.Execute();
                //    }
                //    else
                //    {

                //    }
                //}
                //if (response1.Prefixes != null)
                //{
                //    // return
                //    var data = response;
                //}
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                if (fileStream != null)
                {
                    fileStream.Dispose();
                }
            }


            return(model);
        }
        public static async Task <ProjectProposalDetail> AuthExplicit(string filefullPath, string projectProposalfilename, JObject googleCredentialpathFile, string folderName, GoogleCredentialModel googleCredential, long Projectid, string userid)
        {
            ProjectProposalModel  res   = new ProjectProposalModel();
            ProjectProposalDetail model = new ProjectProposalDetail();

            //there are different scopes, which you can find here https://cloud.google.com/storage/docs/authentication

            //var scopes = new[] { @"https://www.googleapis.com/auth/cloud-platform" };
            var scopes = new[] { @"https://www.googleapis.com/auth/devstorage.full_control" };

            var cts = new CancellationTokenSource();

            StorageService service = new StorageService();
            ClientSecrets  secrets = new ClientSecrets();

            secrets.ClientId     = googleCredentialpathFile["installed"]["client_id"].ToString();
            secrets.ClientSecret = googleCredentialpathFile["installed"]["client_secret"].ToString();

            UserCredential credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                secrets,
                scopes,
                StaticResource.EmailId, CancellationToken.None);

            service = new StorageService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName       = StaticResource.ApplicationName,
            });

            var bucketsQuery = service.Buckets.List(StaticResource.ProjectId);

            bucketsQuery.OauthToken = credential.Token.AccessToken;
            var buckets = bucketsQuery.Execute();

            // create bucket first time

            //var newBucket = new Google.Apis.Storage.v1.Data.Bucket()
            //{
            //    Name = "clear-fusion"
            //};

            //var newBucketQuery = service.Buckets.Insert(newBucket, projectId);
            // newBucketQuery.OauthToken = userCredential.Result.Token.AccessToken;
            //you probably want to wrap this into try..catch block
            // newBucketQuery.Execute();


            //enter bucket name to which you want to upload file
            FileStream fileStream = null;

            try
            {
                ApiResponse response = new ApiResponse();
                Console.WriteLine("reading file path");

                var path = Directory.GetCurrentDirectory() + "/Documents/Proposal/Proposal.docx";
                Console.WriteLine($"File local  Path with environment variables : {path}");
                path = path.Replace(@"\", "/");
                Console.WriteLine($"convert File local Path in linux : {path}");

                var newObject = new Google.Apis.Storage.v1.Data.Object()
                {
                    Bucket = googleCredential.BucketName,
                    Name   = googleCredential.Projects + "/" + folderName + "/" + projectProposalfilename + ".docx",
                };

                fileStream = new FileStream(path, FileMode.Open);

                var uploadRequest = new ObjectsResource.InsertMediaUpload(service, newObject, googleCredential.BucketName, fileStream, "application/vnd.google-apps.document");
                uploadRequest.OauthToken = credential.Token.AccessToken;
                var fileResponse = uploadRequest.Upload();

                Console.WriteLine($"File upload status: {fileResponse.Status}");


                var bucketFolderWithFilePath = newObject.Bucket + "/" + newObject.Name;
                if (fileResponse.Status.ToString() == "Completed" && fileResponse.Exception == null)
                {
                    model.FolderName       = folderName;
                    model.ProposalFileName = projectProposalfilename;
                    model.ProposalWebLink  = bucketFolderWithFilePath;
                    model.ProjectId        = Projectid;
                    model.IsDeleted        = false;
                    model.CreatedById      = userid;
                    model.CreatedDate      = DateTime.Now;
                    model.ProposalExtType  = ".docx";
                }
                else
                {
                    Console.WriteLine("not completed");

                    throw new Exception(StaticResource.UnableToUploadFile);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception occured");

                Console.WriteLine(ex.Message);
            }
            finally
            {
                if (fileStream != null)
                {
                    fileStream.Dispose();
                }
            }

            return(model);
        }
        //****************read credential using service account from directory 21/03/19
        //public static async Task<ProjectProposalDetail> StartProposalByDirectory(string projectProposalfilename, string googleCredentialpathFile, string folderName, ViewModels.Models.Project.GoogleCredentialModel googleCredential, long Projectid, string userid)
        //{
        //    FileStream fileStream = null;
        //    ProjectProposalDetail model = new ProjectProposalDetail();

        //    try
        //    {
        //        ProjectProposalModel res = new ProjectProposalModel();
        //        //var scopes = new[] { @"https://www.googleapis.com/auth/cloud-platform" };
        //        //var cts = new CancellationTokenSource();

        //        //StorageService service = new StorageService();
        //        //UserCredential credential;
        //        //using (var stream = new FileStream(googleCredentialpathFile, FileMode.Open, FileAccess.Read))
        //        //{
        //        //    credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
        //        //          GoogleClientSecrets.Load(stream).Secrets,
        //        //          scopes,
        //        //         googleCredential.EmailId, CancellationToken.None);
        //        //}
        //        //// Create the service.
        //        //service = new StorageService(new BaseClientService.Initializer()
        //        //{
        //        //    HttpClientInitializer = credential,
        //        //    ApplicationName = googleCredential.ApplicationName,
        //        //});

        //        var clientSecrets = new ClientSecrets();
        //        clientSecrets.ClientId = "160690498129-pg9hh4gr2ucta6neiik97tv1sla1qkec.apps.googleusercontent.com";
        //        clientSecrets.ClientSecret = "W0Zn9o2KmJFRXDnCbmq9z5m6";
        //        //there are different scopes, which you can find here https://cloud.google.com/storage/docs/authentication
        //        var scopes = new[] { @"https://www.googleapis.com/auth/devstorage.full_control" };

        //        var cts = new CancellationTokenSource();
        //        var userCredential = await GoogleWebAuthorizationBroker.AuthorizeAsync(clientSecrets, scopes, "*****@*****.**", cts.Token);

        //        await userCredential.RefreshTokenAsync(cts.Token);
        //        var service = new Google.Apis.Storage.v1.StorageService();
        //        Console.WriteLine($"---- credential service----: {service}");

        //        var bucketsQuery = service.Buckets.List(StaticResource.ProjectId);
        //        bucketsQuery.OauthToken = userCredential.Token.AccessToken;
        //        var buckets = bucketsQuery.Execute();


        //        var dir = Directory.GetCurrentDirectory();
        //       // var pathCombine = Path.Combine(dir, @"/Documents/Proposal/Proposal.docx");
        //        var pathCombine = Directory.GetCurrentDirectory() + @"/Documents/Proposal/Proposal.docx";

        //        pathCombine = pathCombine.Replace(@"\", "/");

        //        Console.WriteLine($"--------File local folder Path ----------: {pathCombine}");

        //        fileStream = new FileStream(pathCombine, FileMode.Open);


        //        ApiResponse response = new ApiResponse();


        //        Console.WriteLine($"--------convert to linux window File local folder Path ----------: {fileStream}");

        //        var newObject = new Google.Apis.Storage.v1.Data.Object()
        //        {
        //            Bucket = googleCredential.BucketName,
        //            Name = googleCredential.Projects + "/" + folderName + "/" + projectProposalfilename + "xyz" + ".docx",
        //        };

        //        if (fileStream != null)
        //        {
        //            var uploadRequest = new ObjectsResource.InsertMediaUpload(service, newObject, googleCredential.BucketName, fileStream, "application/vnd.google-apps.document");
        //            uploadRequest.OauthToken = userCredential.Token.AccessToken;
        //            var fileResponse = uploadRequest.Upload();

        //            Console.WriteLine($"File upload on bucket status: {fileResponse.Status}");


        //            var bucketFolderWithFilePath = newObject.Bucket + "/" + newObject.Name;
        //            if (fileResponse.Status.ToString() == "Completed" && fileResponse.Exception == null)
        //            {
        //                model.FolderName = folderName;
        //                model.ProposalFileName = projectProposalfilename;
        //                model.ProposalWebLink = bucketFolderWithFilePath;
        //                model.ProjectId = Projectid;
        //                model.IsDeleted = false;
        //                model.CreatedById = userid;
        //                model.CreatedDate = DateTime.Now;
        //                model.ProposalExtType = ".docx";
        //            }
        //        }

        //        else
        //        {
        //            throw new Exception(StaticResource.UnableToUploadFile);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Console.WriteLine(ex.Message);
        //    }
        //    finally
        //    {
        //        if (fileStream != null)
        //        {
        //            fileStream.Dispose();
        //        }
        //    }
        //    return model;

        //}


        //************************************read credential from directory using auth credentail and using env as well as directory 20/03/2019

        public static async Task <ProjectProposalDetail> StartProposalByDirectory(string projectProposalfilename, string googleCredentialpathFile, string folderName, GoogleCredentialModel googleCredential, long Projectid, string userid)
        {
            FileStream            fileStream = null;
            ProjectProposalDetail model      = new ProjectProposalDetail();

            try
            {
                ProjectProposalModel res = new ProjectProposalModel();
                var scopes = new[] { @"https://www.googleapis.com/auth/cloud-platform" };
                var cts    = new CancellationTokenSource();

                StorageService service = new StorageService();
                UserCredential credential;
                using (var stream = new FileStream(googleCredentialpathFile, FileMode.Open, FileAccess.Read))
                {
                    credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                        GoogleClientSecrets.Load(stream).Secrets,
                        scopes,
                        googleCredential.EmailId, CancellationToken.None);
                }
                // Create the service.
                service = new StorageService(new BaseClientService.Initializer()
                {
                    HttpClientInitializer = credential,
                    ApplicationName       = googleCredential.ApplicationName,
                });
                Console.WriteLine($"---- credential service----: {service}");

                var bucketsQuery = service.Buckets.List(StaticResource.ProjectId);
                bucketsQuery.OauthToken = credential.Token.AccessToken;
                var buckets = bucketsQuery.Execute();


                //enter bucket name to which you want to upload file
                ApiResponse response = new ApiResponse();
                var         path     = Directory.GetCurrentDirectory() + @"/Documents/Proposal/Proposal.docx";

                Console.WriteLine($"--------File local folder Path ----------: {path}");

                path = path.Replace(@"\", "/");
                Console.WriteLine($"--------convert to linux window File local folder Path ----------: {path}");

                var newObject = new Google.Apis.Storage.v1.Data.Object()
                {
                    Bucket = googleCredential.BucketName,
                    Name   = googleCredential.Projects + "/" + folderName + "/" + projectProposalfilename + "xyz" + ".docx",
                };

                fileStream = new FileStream(path, FileMode.Open);
                if (fileStream != null)
                {
                    var uploadRequest = new ObjectsResource.InsertMediaUpload(service, newObject, googleCredential.BucketName, fileStream, "application/vnd.google-apps.document");
                    uploadRequest.OauthToken = credential.Token.AccessToken;
                    var fileResponse = uploadRequest.Upload();

                    Console.WriteLine($"File upload on bucket status: {fileResponse.Status}");


                    var bucketFolderWithFilePath = newObject.Bucket + "/" + newObject.Name;
                    if (fileResponse.Status.ToString() == "Completed" && fileResponse.Exception == null)
                    {
                        model.FolderName       = folderName;
                        model.ProposalFileName = projectProposalfilename;
                        model.ProposalWebLink  = bucketFolderWithFilePath;
                        model.ProjectId        = Projectid;
                        model.IsDeleted        = false;
                        model.CreatedById      = userid;
                        model.CreatedDate      = DateTime.Now;
                        model.ProposalExtType  = ".docx";
                    }
                }

                else
                {
                    throw new Exception(StaticResource.UnableToUploadFile);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                if (fileStream != null)
                {
                    fileStream.Dispose();
                }
            }
            return(model);
        }
Exemple #9
0
        public async Task <ApiResponse> Handle(GetProjectproposalsByIdQuery request, CancellationToken cancellationToken)
        {
            ApiResponse          response = new ApiResponse();
            ProjectProposalModel obj      = new ProjectProposalModel();

            try
            {
                ProjectProposalDetail detail = await _dbContext.ProjectProposalDetail.FirstOrDefaultAsync(x => x.ProjectId == request.ProjectId &&
                                                                                                          x.IsDeleted == false);

                ApproveProjectDetails Projectdetail = await _dbContext.ApproveProjectDetails.FirstOrDefaultAsync(x => x.ProjectId == request.ProjectId &&
                                                                                                                 x.IsDeleted == false);

                if (detail != null)
                {
                    obj.ProjectProposaldetailId = detail.ProjectProposaldetailId;
                    obj.FolderName              = detail.FolderName;
                    obj.FolderId                = detail.FolderId;
                    obj.ProposalFileName        = detail.ProposalFileName;
                    obj.ProjectId               = detail.ProjectId;
                    obj.ProposalFileId          = detail.ProposalFileId;
                    obj.EDIFileName             = detail.EDIFileName;
                    obj.EdiFileId               = detail.EdiFileId;
                    obj.BudgetFileName          = detail.BudgetFileName;
                    obj.BudgetFileId            = detail.BudgetFileId;
                    obj.ConceptFileName         = detail.ConceptFileName;
                    obj.ConceptFileId           = detail.ConceptFileId;
                    obj.PresentationFileName    = detail.PresentationFileName;
                    obj.ProposalWebLink         = detail.ProposalWebLink;
                    obj.EDIFileWebLink          = detail.EDIFileWebLink;
                    obj.BudgetFileWebLink       = detail.BudgetFileWebLink;
                    obj.ConceptFileWebLink      = detail.ConceptFileWebLink;
                    obj.PresentationFileWebLink = detail.PresentationFileWebLink;
                    obj.ProposalExtType         = detail.ProposalExtType;
                    obj.EDIFileExtType          = detail.EDIFileExtType;
                    obj.BudgetFileExtType       = detail.BudgetFileExtType;
                    obj.ConceptFileExtType      = detail.ConceptFileExtType;
                    obj.PresentationExtType     = detail.PresentationExtType;
                    obj.ProposalStartDate       = detail.ProposalStartDate;
                    obj.ProposalBudget          = detail.ProposalBudget;
                    obj.ProposalDueDate         = detail.ProposalDueDate;
                    obj.ProjectAssignTo         = detail.ProjectAssignTo;
                    obj.IsProposalAccept        = detail.IsProposalAccept;
                    obj.CurrencyId              = detail.CurrencyId;
                    obj.UserId     = detail.UserId;
                    obj.IsApproved = Projectdetail?.IsApproved;
                    response.data.ProjectProposalModel = obj;
                    response.StatusCode = StaticResource.successStatusCode;
                    response.Message    = "Success";
                }
                else
                {
                    response.StatusCode = StaticResource.failStatusCode;
                    response.Message    = StaticResource.NoDataFound;
                }
            }
            catch (Exception ex)
            {
                response.StatusCode = StaticResource.failStatusCode;
                response.Message    = StaticResource.SomethingWrong + ex.Message;
            }
            return(response);
        }
Exemple #10
0
        public static Task <ProjectProposalModel> GetProjectProposal([ActivityTrigger] string proposalId,
                                                                     ILogger log)
        {
            ProjectProposalModel model = new ProjectProposalModel(proposalId)
            {
                Title       = "Project title",
                Description = "Project description",
                Features    = new List <FeatureModel>
                {
                    new FeatureModel
                    {
                        Name        = "Feature 1",
                        Description = "Feature 1 description",
                        Tasks       = new List <TaskModel>
                        {
                            new TaskModel
                            {
                                Name          = "Task 1",
                                Description   = "Task 1 description",
                                EstimatedTime = new TimeSpan(3, 0, 0)
                            },
                            new TaskModel
                            {
                                Name          = "Task 2",
                                Description   = "Task 2 description",
                                EstimatedTime = new TimeSpan(3, 0, 0)
                            },
                            new TaskModel
                            {
                                Name          = "Task 3",
                                Description   = "Task 3 description",
                                EstimatedTime = new TimeSpan(3, 0, 0)
                            }
                        }
                    },
                    new FeatureModel
                    {
                        Name        = "Feature 2",
                        Description = "Feature 2 description",
                        Tasks       = new List <TaskModel>
                        {
                            new TaskModel
                            {
                                Name          = "Task 1",
                                Description   = "Task 1 description",
                                EstimatedTime = new TimeSpan(3, 0, 0)
                            },
                            new TaskModel
                            {
                                Name          = "Task 2",
                                Description   = "Task 2 description",
                                EstimatedTime = new TimeSpan(3, 0, 0)
                            }
                        }
                    }
                },
                Team = new TeamModel
                {
                    Name    = "Team name",
                    Members = new List <TeamMemberModel>
                    {
                        new TeamMemberModel
                        {
                            Id        = Guid.NewGuid(),
                            FirstName = "Jean",
                            LastName  = "Dupond"
                        },
                        new TeamMemberModel
                        {
                            Id        = Guid.NewGuid(),
                            FirstName = "Pierre",
                            LastName  = "Jacques"
                        }
                    }
                }
            };

            return(Task.FromResult(model));
        }