Often times in Xaml you’ve got some labels, or buttons that you don’t want to show if something in the ViewModel is null or empty. Take the example below. The ViewModel has a nullable property rating. If it is non-null a handful of controls are rendered to show it graphically and numerically. If it is null however we don’t want to see any of that stuff. This converter helps hide elements of something in the ViewModel is null or empty string. Continue reading
dynamic keyword is used to declare variables that should be late-bound.
If you want to use late binding, for any real or imagined type, you use the
dynamic keyword and the compiler does the rest.
So, if you need to handle a dynamic type: use
dynamic and if you need to handle dynamic data such as XML or JSON: use ExpandoObject Continue reading
It is added to added to .NET 4.0.
Read more HERE.
Represents an object whose members can be dynamically added and removed at run time.
Shortly, ExpandoObject can help you create complex hierarchical objects. For example, imagine that you have a dictionary within a dictionary:
Dictionary<String, object> dict = new Dictionary<string, object>(); Dictionary<String, object> address = new Dictionary<string,object>(); dict["Address"] = address; address["State"] = "WA"; Console.WriteLine(((Dictionary<string,object>)dict["Address"])["State"]);
The deeper is the hierarchy, the uglier is the code. With ExpandoObject it stays elegant and readable.
dynamic expando = new ExpandoObject(); expando.Address = new ExpandoObject(); expando.Address.State = "WA"; Console.WriteLine(expando.Address.State);
Second, as it was already pointed out, ExpandoObject implements INotifyPropertyChanged interface which gives you more control over properties than a dictionary.
Let me make few statements as my background for concept.
IEnumerable<T> interface is a generic interface that provides an abstraction for looping over elements. In addition to providing
foreach support, it allows you to use extension methods in the
System.Linq namespace. Continue reading
Read original Post HERE.
This question has two fold answers – 1) When the table is already created and 2) When the table is to be created run time. In this blog post we will explore both the scenarios together.
However, first let us create a stored procedure which we will use for our example. Continue reading
- Asp.Net MVC is used to create web applications that returns both views and data but Asp.Net Web API is used to create full blown HTTP services with easy and simple way that returns only data not view.
- Web API helps to build REST-ful services over the .NET Framework and it also support content-negotiation(it’s about deciding the best response format data that could be acceptable by the client. it could be JSON,XML,ATOM or other formatted data), self hosting which are not in MVC. Continue reading
- It is based on SOAP and return data in XML form.
- It support only HTTP protocol.
- It is not open source but can be consumed by any client that understands xml.
- It can be hosted only on IIS. Continue reading