Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async Task<ActionResult> Messages()
- {
- var collection = db.Messages;
- ViewBag.NotifierEntity = db.GetNotifierEntity<Message>(collection).ToJson();
- return View(await collection.ToListAsync());
- }
- public async Task<ActionResult> Messages()
- {
- var username = CurrentUser().UserName;
- var collection = db.Messages.Where(m => m.Recipients
- .All(u => u.UserName == username));
- ViewBag.NotifierEntity = db.GetNotifierEntity<Message>(collection).ToJson();
- return View(await collection.ToListAsync());
- }
- public static NotifierEntity FromJson(string value)
- {
- if (String.IsNullOrEmpty(value))
- throw new ArgumentNullException("NotifierEntity Value can not be null.");
- //return new JavaScriptSerializer().Deserialize<NotifierEntity>(value);
- return JsonConvert.DeserializeObject<NotifierEntity>(value, new JsonSerializerSettings {
- NullValueHandling = NullValueHandling.Ignore
- });
- }
- [Newtonsoft.Json.JsonSerializationException] {"Error converting value "p__linq__0" to type 'System.Data.SqlClient.SqlParameter'. Path 'SqlParameters[0]', line 1, position 1010."}
- [InnerException] {"Could not cast or convert from System.String to System.Data.SqlClient.SqlParameter."}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement