• SnapObjects .NET API Documentation

    This site offers links to all the available documents related to SnapObjects .NET development. If you want to find the documents of the other Appeon products (PowerBuilder IDE, SnapDevelop, DataWindow Converter, PowerScript Migrator, PowerServer, and InfoMaker), go to the Appeon Documentation Center.

    SnapObjects .NET API

    Getting Started:

    Features List of SnapObjects 5.x

    Installation Guide of SnapObjects 5.x

    Release Bulletin of SnapObjects 5.x

    API Reference:

    SnapObjects .NET API Reference (5.x) (4.x) (3.1.x) (3.0.0) (2.1.0) (2.0.0) (1.0.x)

    Tutorials:

    CRUD Operations with SqlModelMapper

    Add Data Validation to SqlModelMapper

    Developer Guides:

    Working with Transactions in SnapObjects

    Using Nested Models in SqlModelMapper

    Tracking Actions with SqlModelMapper

    Type-Safe Queries Using SnapObjects API

    Show / Hide Table of Contents

    Model Class: CourseAndOnlineInfo.cs

    using System;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using SnapObjects.Data;
    using Newtonsoft.Json;
    using System.Collections.Generic;
    
    namespace Appeon.ApiDoc.Models.School
    {
        /// <summary>
        /// This model class maps to the dbo.Course table. 
        /// It uses the primary key to generate the Where clause for the Update operation.
        /// 
        /// CourseID is the primary key.
        /// 
        /// The OnlineCourses property is applied with the ModelEmbedded attribute.
        /// The ModelEmbedded attribute defines the one-to-one relationship between the Course and 
        /// the OnlineCourse record.
        /// </summary>
        [Table("Course", Schema = "dbo")]
        [UpdateWhereStrategy(UpdateWhereStrategy.KeyColumns)]
        public class CourseAndOnlineInfo
        {
            [Key]
            public Int32 CourseID { get; set; }
    
            public String Title { get; set; }
    
            public Int32 Credits { get; set; }
    
            public Int32 DepartmentID { get; set; }
    
            [JsonIgnore]
            [SetValue("$CourseID", "$CourseID", SetValueStrategy.Always)]
            [ModelEmbedded(typeof(OnlineCourse), ParamValue = "$CourseID", 
                CascadeCreate = true, CascadeDelete = true)]
            public OnlineCourse OnlineCourse { get; set; }
        }
    }
    
    Back to top Generated by Appeon