c# - Using a generic value -


i have common problem looks this. user may choose between inputing text or date , have 1 object/class in background storing value. make object/class generic possible can use value without asking date or text , without having convert either string or datetime. possible?

what suggetions guys solve properly? think kind of class design question best way design such case?

edit: havent started coding out yet. thinking of how of how create class , funktions shall offer. in dll cases user has textbox enter number or text or date. use without having ask it. mean without having many ifs later in code. scenario user has textbox , enter later example send value web service or exanple store database need type.

its class design problem. how desin generic possible can ship value without asking is?

since keep repeating question, i'll answer it. without further information what you're trying do, answer occurs me use the object type. depending on end doing value, has many potential downsides, can't comment on without knowing more scenario.

so, there: .net object type represents object type not specified, better or worse. doesn't have the .net concept of generics.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -