Explanation:

Box 1: EntityReference
Lookup
Associate table rows on create
You can associate any new row with an existing row when you create it in the same way you would when updating it. You must use an EntityReference to set the value of a lookup column (attribute).
This lookup assignment is the same for both early and late-bound styles.
//Use Entity class with entity logical name
var account = new Entity("account");
// set attribute values
//string primary name
account["name"] = "Sample Account";
Guid primarycontactid = new Guid("e6fa5509-2582-e811-a95e-000d3af40ae7");
account["primarycontactid"] = new EntityReference("contact", primarycontactid);
//Create the account
Guid accountid = svc.Create(account);
Box 2: OptionSetValueCollection
Choices
Dataverse, Choices columns
Customizers can define a column that allows selection of multiple options. The MultiSelectPicklistAttributeMetadata class defines a column type that inherits from the EnumAttributeMetadata class. Just like the PicklistAttributeMetadata class, this column includes an OptionSetMetadata.Options property that contains the valid options for the column. The difference is that the values you get or set are an *OptionSetValueCollection* type that contains an array of integers representing the selected options. Formatted values for this column are a semi-colon separated string containing the labels of the selected options.
Note: Create choices with code
The easiest way to create choices is to use the column editor in the customization tools. More information: How to create and edit columns
But if you need to automate creation of this kind of column you can use C# code like the following with the SDK for .NET that creates choices to allow choices of outdoor activities to the contact table. More information: Create columns
private const int _languageCode = 1033; //English
MultiSelectPicklistAttributeMetadata outDoorActivitiesAttribute = new MultiSelectPicklistAttributeMetadata()
{
SchemaName = "sample_OutdoorActivities",
LogicalName = "sample_outdooractivities",
DisplayName = new Label("Outdoor activities", _languageCode),
RequiredLevel = new AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None),
Description = new Label("Outdoor activities that the contact likes.", _languageCode),
OptionSet = new OptionSetMetadata()
{
IsGlobal = false,
OptionSetType = OptionSetType.Picklist, // Picklist
Options = {
new OptionMetadata(new Label("Swimming",_languageCode),1),
new OptionMetadata(new Label("Hiking",_languageCode),2),
new OptionMetadata(new Label("Mountain Climbing",_languageCode),3),
new OptionMetadata(new Label("Fishing",_languageCode),4),
new OptionMetadata(new Label("Hunting",_languageCode),5),
new OptionMetadata(new Label("Running",_languageCode),6),
new OptionMetadata(new Label("Boating",_languageCode),7),
new OptionMetadata(new Label("Skiing",_languageCode),8),
new OptionMetadata(new Label("Camping",_languageCode),9)}
}
};
CreateAttributeRequest createAttributeRequest = new CreateAttributeRequest
{
EntityName = "contact",
Attribute = outDoorActivitiesAttribute
};
var response = (CreateAttributeResponse)service.Execute(createAttributeRequest);