コード例 #1
0
        public static async Task <Investor> GetOrCreateInvestorAsync(this MasterSideLetterDataAccess dataAccess, string name, string type)
        {
            var existing = await dataAccess.GetInvestorByNameAsync(name);

            if (existing != null)
            {
                return(existing);
            }
            var newInvestor = new Investor {
                Name = name, InvestorType = type
            };

            newInvestor.Id = await dataAccess.CreateInvestorAsync(newInvestor);

            return(newInvestor);
        }