MOON.ORM 3.6发布下载 及帮助文档


 

 

代码功能演示

using System;
using System.Collections.Generic;

using Moon.Orm;
using  MoonDB;

namespace r
{
    
    
    
     class Program
    {
         public  static  void Main( string[] args)
        {
             
             // 数据添加
            PersonSet person= new PersonSet();
            person.Age= 133;
            person.AgePeriod= 1;
            person.IsBeiJing= true;
            person.Sex= true;
            person.UserName= " ";
            
            DBFactory.Add(person);
            Console.WriteLine( " 新的数据唯一识别标志: "+person.GetOnlyMark());
            
             // 另类数据添加
            person.Set(PersonSetTable.UserName, " 另类 ");
            person.Set(PersonSetTable.Age, 12);
            person.Set(PersonSetTable.AgePeriod, 11);
            person.Set(PersonSetTable.IsBeiJing, false);
            person.Set(PersonSetTable.Sex, true);
            DBFactory.Add(person);
            Console.WriteLine( " 新的数据11唯一识别标志: "+person.GetOnlyMark());
            
             // 数据删除
             long ret= DBFactory.DeleteWhen(PersonSetTable.IsBeiJing.Equal( 1).And(PersonSetTable.Age.BiggerThan( 12)));
            Console.WriteLine( " 被删除的条数: "+ret);
            
             // 改数据
             
             
            person.UserName= " 另类修改后 ";
            person.SetOnlyMark(PersonSetTable.UserName.Equal( " 另类 "));
            DBFactory.Update(person);
            
             // 查询
            PersonSet p=DBFactory.GetEntity<PersonSet>(
                PersonSetTable.UserName.Equal( " 另类修改后 "));
            Console.WriteLine(p.Age);
            
             // 查询一个字段
             int age=DBFactory.GetOneField< int>(PersonSetTable.Age, PersonSetTable.ID.Equal( 5));
            Console.WriteLine(age);
             Console.Write( " Press any key to continue . . .  ");
            Console.ReadKey( true);
            
             
            
        }
    }
}
 

 

 

 

 

 

使用方法

优势

 

QQ群技术交流:   
     216965349

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM