how to take value from array from mongodb collection and am using mvc
public class PaydeskUser
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string id { get; set; }
[Required]
[DataType(DataType.EmailAddress)]
public string Email { get; set; }
[Required]
public string Password { get; set; }
[Required]
public string CompanyName { get; set; }
[Required]
public string IndustryName { get; set; }
[Required]
public string Address { get; set; }
[Required]
public string ZipCode { get; set; }
[Required]
public string City { get; set; }
[Required]
public string RegisteredDate { get; set; }
public string ContactPerson { get; set; }
[Required]
public string Status { get; set; }
public string Licence { get; set; }
public string OrganizationNumber { get; set; }
public List Users { get; set; }
}
public class User
{
public User()
{
PayDesks = new List();
}
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string Phone { get; set; }
public string Status { get; set; }
public string Date { get; set; }
public string ProfilePicture { get; set; }
public List PayDesks { get; set; }
}
i want to take value from User
And in controller i wrote this
try
{
var database = PosConnection.GeniusPayDB;
var collection = database.GetCollection("Company");
return collection.AsQueryable().ToList();
}
catch
{
throw;
}
what will be the mistake i had done
Replies
Know the answer? Post it — somebody with the same question will find it here.