Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I  got the following error in production Value cannot be null. (Parameter 'source')

My enum values are

public enum Offer{
  
    None=1,
    all,
    stop,
   
}
Class Emp{
   [Column(TypeName = "jsonb")]
   public list<Offer> offer { get; set; }

    public D d { get; set }

  public string FullName { get; set }

}

class D
{
   
   public string age { get; set }

   public string countryCode { get; set }

} 
public async Task<List<Emp>> ListEmp( List<Offer> offer ){
var query= catalogDb.Emp.Include(a=>a.D) .Where(a=>a.Name="xyz") .AsQueryable();
}
if(offer.Count>0){

                var result=query.AsEnumerable()
                                .Where(y => y.Offers.Any(z => offer.Contains(z)))
                                .ToList();
                return result;
            }
return await query.ToListAsync();
}
when I run  dotnet publish and   dotnet publish -c Release -o out then i run  dotnet out/Emp.dll
then i got 
   Unhandled exception. System.ArgumentNullException: String reference not set to an instance of a String. (Parameter 's')
   at System.Text.Encoding.GetBytes(String s)
could you pleas help me to solved this
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.7k views
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...