我的数据库采用以下格式生成的json文件
[{"UserInfoID":"57adb1e8-27ab-e311-afb2-eca86bf5549a","DbType":"OFFLINE","UserID":"d3f3b6a6-77aa-436a-a73c-d6655566888b","GraphID":"56adb1e8-27ab-e311-afb2-eca86bf5549a","UserLevelEnumId":"00000000-0000-0000-0000-000000000000","Title":"Mr/Mrs","FirstName":"Neeraj","MiddleName":null,"LastName":"Mehta","Birthdate":"\/Date(699388200000)\/","Gender":"Male","Email":"neer.srmiet@gmail.com","MobileNo":"+918950333123","Country":"India","Zipcode":133201,"UserLevel":999,"CountFollowers":0,"CountFollows":0,"CountFiles":0,"CountPhotos":0,"Quote":"Empowering Education","AvatarURL":"/UserFiles/Images/X50/IMAG1289_1vv4djTgspjjsl87fquality_50.jpg","PosterURL":null,"isVerified":true,"VerificationCount":0,"UserEnumType":"USER","UserCreatorId":"d3f3b6a6-77aa-436a-a73c-d6655566888b"}
我已将此数据下载到文件中,现在我想将此数据上传到具有相同结构和相同属性的其他数据库中 如何从文件和建议中上传这个?
答案 0 :(得分:0)
如果要使用ajax上传此json数据,请创建以下操作:
[HttpPost]
public ActionResult(User user) {
// Add input validation here.
// Add the user entity to the database.
UsersContext context = new UsersContext();
context.Users.Add(user);
context.SaveChanges();
}