Showing posts with label csharp. Show all posts
Showing posts with label csharp. Show all posts

6/3/23

Azure OpenAI API Service with CSharp

The OpenAI Service is a cloud-based API that provides access to Large Language Models (LLM) and Artificial Intelligence (AI) Capabilities. This API allows developers to leverage the LLM models to create AI application that can perform Natural Language Processing (NLP) tasks such as text generation,...

3/1/15

Active Directory SetPassword or ChangePassword Possible Errors

When we try to update the user password on an Active Directory (AD or AD LDS) environment, we usually read on the documentation about the basic steps that are needed to set or change the password to a user. If we follow those basic steps, we would be very lucky of all goes well. There are often several other requirements that need to be met to be able to set the password. Some of these include: The...

11/5/12

The type was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically

When trying to serialize a complex object using the XmlSerializer, we can encountered a Type was not expected exception. This exception is generated as a result of a property declared as a base type, but the actual reference is done with a child class instance. For example: og-bit.com Class Declaration: public class Account { int number { get; set; } } public class Client { public...

9/8/12

What is the difference between ObjectSet and EntityCollection?

When working with the Entity framework, you may see that there are two types of collection created, ObjectSet and EntityCollection. Many of us get a bit confused as of why there are two types of collections and about their use. I will try to describe my understanding of their differences: ObjectSet Definition from MSDN: public class ObjectSet<TEntity> : ObjectQuery<TEntity>,...

7/20/12

Fluent Interface to Simplify an API

The mail goal of an API is to facilitate the use of commands and attributes to achieve certain functionality.  Over time, an API may have evolved and become somewhat obscure on its usage which reduces its usability and increases the implementation time. To clean/simplify an API you can apply a fluent interface to it. This allows you to modify the API with a more descriptive interface which improves...