Pass in an enum as a method parameter

前端 未结 4 1692
北海茫月
北海茫月 2020-12-30 18:52

I have declared an enum:

public enum SupportedPermissions
{
    basic,
    repository,
    both
}

I also have a POCO like this:

<         


        
4条回答
  •  猫巷女王i
    2020-12-30 19:39

    public string CreateFile(string id, string name, string description, SupportedPermissions supportedPermissions)
    {
        file = new File
        {  
           Name = name,
            Id = id,
            Description = description,
            SupportedPermissions = supportedPermissions
        };
    
        return file.Id;
    }
    

提交回复
热议问题