Unknown column 'u.MemberId' in 'field list'

0

I have a project that is .net core 2.0. I have an entity below.

public class UsersCoupon
{
    public int Id { get; set; }
    public int CouponId { get; set; }
    public int UserId { get; set; }
    public int OrderId { get; set; }
    public DateTime? UsedDate { get; set; }
}

When i try to get Datas from db(mysql) i am getting this error.

MySql.Data.MySqlClient.MySqlException
  HResult=0x80004005
  Message=Unknown column 'u.MemberId' in 'field list'
  Source=MySqlConnector
Inner Exception 1:
MySqlException: Unknown column 'u.MemberId' in 'field list'

I dont have any MemberId column in the UsersCoupons table in my db. I am using Pomelo.EntityFramwork.Core.Mysql 2.0.0

Note: When i change the UserId column name to MemberId it is working. But i want to use UserId.How can it be?

mysql
asp.net-core-2.0
pomelo-entityframeworkcore-mysql
asked on Stack Overflow Nov 19, 2019 by Ezgi Erarslan • edited Dec 4, 2019 by BanditoBunny

1 Answer

0

The information you provided is not enough to find the issue. Please post us a small example project, that reproduces the issue.

You can also just do a search in your whole project for MemberId or Member, to find the root of the problem, because this name has to originate from somewhere.

Of course you can also just try upgrading to 2.2.6 or 3.0.0, because Pomelo's 2.0.0 is quite old and a lot of significant changes were implemented since then.

answered on Stack Overflow Nov 30, 2019 by lauxjpn • edited Nov 30, 2019 by lauxjpn

User contributions licensed under CC BY-SA 3.0