Exemple #1
0
 public override int[] CreateIndex(object dataSource)
 {
     return(DataLoaderHelper.CreateNameMapIndex(dataSource, 2
                                                , new KeyValuePair <int, string>(0, "IntValue")
                                                , new KeyValuePair <int, string>(1, "StrValue")
                                                ));
 }
Exemple #2
0
 public override int[] CreateIndex(object dataSource)
 {
     return(DataLoaderHelper.CreateNameMapIndex(dataSource, 6
                                                , new KeyValuePair <int, string>(0, "CustomerID")
                                                , new KeyValuePair <int, string>(1, "CustomerName")
                                                , new KeyValuePair <int, string>(2, "ContactName")
                                                , new KeyValuePair <int, string>(3, "Address")
                                                , new KeyValuePair <int, string>(4, "PostalCode")
                                                , new KeyValuePair <int, string>(5, "Tel")
                                                ));
 }
Exemple #3
0
 public override int[] CreateIndex(object dataSource)
 {
     return(DataLoaderHelper.CreateNameMapIndex(dataSource, 7
                                                , new KeyValuePair <int, string>(0, "ProductID")
                                                , new KeyValuePair <int, string>(1, "ProductName")
                                                , new KeyValuePair <int, string>(2, "CategoryID")
                                                , new KeyValuePair <int, string>(3, "Unit")
                                                , new KeyValuePair <int, string>(4, "UnitPrice")
                                                , new KeyValuePair <int, string>(5, "Remark")
                                                , new KeyValuePair <int, string>(6, "Quantity")
                                                ));
 }
Exemple #4
0
 public override int[] CreateIndex(object dataSource)
 {
     return(DataLoaderHelper.CreateNameMapIndex(dataSource, 19
                                                , new KeyValuePair <int, string>(0, "rid")
                                                , new KeyValuePair <int, string>(1, "intA")
                                                , new KeyValuePair <int, string>(2, "timeA")
                                                , new KeyValuePair <int, string>(3, "moneyA")
                                                , new KeyValuePair <int, string>(4, "stringA")
                                                , new KeyValuePair <int, string>(5, "boolA")
                                                , new KeyValuePair <int, string>(6, "guidA")
                                                , new KeyValuePair <int, string>(7, "intB")
                                                , new KeyValuePair <int, string>(8, "moneyB")
                                                , new KeyValuePair <int, string>(9, "guidB")
                                                , new KeyValuePair <int, string>(13, "shortB")
                                                , new KeyValuePair <int, string>(14, "charA")
                                                , new KeyValuePair <int, string>(15, "charB")
                                                , new KeyValuePair <int, string>(16, "img")
                                                , new KeyValuePair <int, string>(17, "g2")
                                                , new KeyValuePair <int, string>(18, "ts")
                                                ));
 }
Exemple #5
0
        public async Task <ActionResult> PopulateProfile(string email)
        {
            if (email == null)
            {
                return(BadRequest(new { status = "error", message = "Invalid email address." }));
            }

            Profile profile = DbContext.Profile
                              .FirstOrDefault(p => p.Email.ToLower().Equals(email.ToLower()));

            if (profile != null)
            {
                return(BadRequest(new { status = "error", message = string.Format("Profile already exists with email address: {0} ", email) }));
            }

            DataLoaderHelper helper = new DataLoaderHelper();

            profile = helper.Populate(email);

            DbContext.Profile.Add(profile);
            await DbContext.SaveChangesAsync();

            return(Ok(new { status = "success" }));
        }