局部变量 临时变量,linq中有哪些局部变量类型

科技资讯 投稿 6400 0 评论

局部变量 临时变量,linq中有哪些局部变量类型

我们常常会遇到一些问题,比如linq中有哪些局部变量类型等问题,我们该怎么处理呢。下面这篇文章将为你提供一个解决思路,希望能帮你解决到相关问题。

一、基础类型

LINQ支持多种基础类型,如:int、string、bool等。


int i = 1;
string s = "Hello World";
bool b = true;

二、实体类型

LINQ也支持实体类型,如:类、结构体等,它们的定义如下:


public class Student
{
    public string Name { get; set; }
    public int Age { get; set; }
}

public struct Point
{
    public int X { get; set; }
    public int Y { get; set; }
}

三、泛型类型

LINQ还支持泛型类型,如:List、Dictionary等,它们的定义如下:


List list = new List();
Dictionary dict = new Dictionary();

总结

以上就是为你整理的linq中有哪些局部变量类型全部内容,希望文章能够帮你解决相关问题,更多请关注本站相关栏目的其它相关文章!

编程笔记 » 局部变量 临时变量,linq中有哪些局部变量类型

赞同 (34) or 分享 (0)
游客 发表我的评论   换个身份
取消评论

表情
(0)个小伙伴在吐槽