c# - Type conversion from string to User defined type -


I have a string type that will be assigned to the type of owner ' user '. My method gives the format GetFullName in the ' string format and I have to specify the owner of' user 'type.

  def.Owner = uf.GetFullName (line ["assigned"]. ToString ());  

Any suggestion will be useful,

then you need something Like:

  public class user {... public stable underlying operator user (string x) {return new user (x); }}  

Personally, I am not a fan of underlying conversions, though. You say that you have to "assign" it in this way ... what is wrong with a clear producer or steady method call? Maybe string ? An extension method ( ToUser ) on


Comments