skip to Main Content

Asp.net – Entity Framework: Save Private Field

I'm using Entity Framework with MongoDB. I have a class, Account with the following field: private readonly byte[] salt; Account is configured in Entity Framework like so: protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<Account>().ToCollection("accounts"); } When I save an…

VIEW QUESTION

C# .net and Mysql insert statement fails during command execution

I am trying to insert into the mysql database the following record in a Create() method in a Repository class: MySqlCommand command = new MySqlCommand("INSERT INTO `documentdetails` (?dtoDocumentId);", _connection); command.Connection = _connection; command.CommandType = CommandType.Text; command.Parameters.Add("?dtoDocumentId", MySqlDbType.Int64).Value=documentDetail.DocumentId; command.ExecuteNonQuery(); The documentId…

VIEW QUESTION
Back To Top
Search