Sivakumar

Sivakumar

  • NA
  • 551
  • 217.7k

cannot convert from 'System.Enum' to 'byte'

Sep 23 2015 3:51 AM
Hi,
 
When I execute my project i getting error like this 
 
cannot convert from 'System.Enum' to 'byte'
 
Error 5 The best overloaded method match for 'Kiwi.Service.BL.TeamManager.UpdateMemberRole(int, int, byte)' has some invalid arguments D:\Source Control\Kiwi\source\Service\Kiwi.Service.API.Controller\Controllers\TeamsController.cs 41 20 Kiwi.Service.API.Controller
 
This is my code :
 
[Route("{teamId}/metrics/{memberId}={memberrole}")]
public int UpdateMemberRole(int teamId,int memberId, Enum memberrole)
{
return _team.UpdateMemberRole(teamId, memberId, memberrole);
} 
 
This is my MemberRole model class :
 
public enum MemberRole : short
{
Default = 1,
Observer = 2,
Moderator = 3
 
And this is my table :
 
 
 
Please give me a solution for that.
 
Thank you.

Answers (5)