How to determine if there is a specific short integer variable value in the array?How do you sort a dictionary by value?How do you give a C# Auto-Property a default value?Adding values to a C# arrayHow do you convert a byte array to a hexadecimal string, and vice versa?How to loop through all enum values in C#?How to determine if a decimal/double is an integer?Databinding issue with stopwatched elapsedHow to determine if a type implements an interface with C# reflectionPass an array of integers to ASP.NET Web API?How to convert byte array to string

How would two worlds first establish an exchange rate between their currencies

Starring Samurais - Several Scribbled Short Stories

Where does the expression "triple-A" comes from?

Are there any space probes or landers which regained communication after being lost?

How to split a string by the third .(dot) delimiter

Is there a standard terminology for female equivalents of terms such as 'Kingdom' and if so, what are the most common terms?

Might have gotten a coworker sick, should I address this?

My favorite color is blue what is your favorite color?

Two different colors in an Illustrator stroke / line

Number of aircraft to operate in an airline company

What is going on: C++ std::move on std::shared_ptr increases use_count?

Is there any detail about ambulances in Star Wars?

SQL Server table with 4,000,000 rows is 40GB

Procedure for traffic not in sight

CBP interview, how serious should I take it?

I see your BIDMAS and raise you a BADMIS

What was the first LISP compiler?

Does the word “uzi” need to be capitalized?

Is it appropriate for a professor to require students to sign a non-disclosure agreement before being taught?

Why should I always enable compiler warnings?

Is the space of Radon measures a Polish space or at least separable?

Are programming languages necessary/useful for operations research practitioner?

Could the government trigger by-elections to regain a majority?

Is BitLocker useful in the case of stolen laptop?



How to determine if there is a specific short integer variable value in the array?


How do you sort a dictionary by value?How do you give a C# Auto-Property a default value?Adding values to a C# arrayHow do you convert a byte array to a hexadecimal string, and vice versa?How to loop through all enum values in C#?How to determine if a decimal/double is an integer?Databinding issue with stopwatched elapsedHow to determine if a type implements an interface with C# reflectionPass an array of integers to ASP.NET Web API?How to convert byte array to string






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have an array of integers, and a short integer variable, I want to know if the value of this short integer exists in the array.



I tried using Contains, but I don't support short integer variables, so I can't help it.



 public List<Client> GetLogList(string userId,
string flagId,
string itemId,
int[] labIds,
string deviceId,
int[] actionType,
int? signStatus,
DateTime? startDate,
DateTime? endDate,
int pageIndex,
int pageSize)

DB.Queryable<Client, User, Item, Flag, ClientDevice, LogItem>
((clientOp, labUser, labItem, rfidFlag, clientDev, labUseLog) =>
clientOp.DeviceId == clientDev.DeviceId
&& clientOp.Operator == labUser.UserId
&& clientOp.FlagId == rfidFlag.FlagId
&& rfidFlag.ItemId == labItem.ItemId
&& clientOp.Id == labUseLog.Id)
.WhereIF(!string.IsNullOrEmpty(userId), clientOp =>
clientOp.Operator == userId)
.WhereIF(!string.IsNullOrEmpty(flagId), clientOp =>
clientOp.FlagId == flagId)
.WhereIF(!string.IsNullOrEmpty(itemId), rfidFlag =>
rfidFlag.ItemId == Convert.ToInt32(itemId))
.WhereIF(!string.IsNullOrEmpty(deviceId), clientOp =>
clientOp.DeviceId == deviceId)
.WhereIF(actionType != null && actionType.Count() > 0,
clientOp => clientOp.ActionType.Contains(actionType)))










share|improve this question


























  • You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?

    – James Zhang
    Mar 28 at 8:51











  • I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.

    – Damien_The_Unbeliever
    Mar 28 at 8:52











  • Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.

    – James Zhang
    Mar 28 at 9:00











  • And it wasn't just to write actionType.Contains(clientOp.ActionType)?

    – Damien_The_Unbeliever
    Mar 28 at 9:31

















0















I have an array of integers, and a short integer variable, I want to know if the value of this short integer exists in the array.



I tried using Contains, but I don't support short integer variables, so I can't help it.



 public List<Client> GetLogList(string userId,
string flagId,
string itemId,
int[] labIds,
string deviceId,
int[] actionType,
int? signStatus,
DateTime? startDate,
DateTime? endDate,
int pageIndex,
int pageSize)

DB.Queryable<Client, User, Item, Flag, ClientDevice, LogItem>
((clientOp, labUser, labItem, rfidFlag, clientDev, labUseLog) =>
clientOp.DeviceId == clientDev.DeviceId
&& clientOp.Operator == labUser.UserId
&& clientOp.FlagId == rfidFlag.FlagId
&& rfidFlag.ItemId == labItem.ItemId
&& clientOp.Id == labUseLog.Id)
.WhereIF(!string.IsNullOrEmpty(userId), clientOp =>
clientOp.Operator == userId)
.WhereIF(!string.IsNullOrEmpty(flagId), clientOp =>
clientOp.FlagId == flagId)
.WhereIF(!string.IsNullOrEmpty(itemId), rfidFlag =>
rfidFlag.ItemId == Convert.ToInt32(itemId))
.WhereIF(!string.IsNullOrEmpty(deviceId), clientOp =>
clientOp.DeviceId == deviceId)
.WhereIF(actionType != null && actionType.Count() > 0,
clientOp => clientOp.ActionType.Contains(actionType)))










share|improve this question


























  • You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?

    – James Zhang
    Mar 28 at 8:51











  • I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.

    – Damien_The_Unbeliever
    Mar 28 at 8:52











  • Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.

    – James Zhang
    Mar 28 at 9:00











  • And it wasn't just to write actionType.Contains(clientOp.ActionType)?

    – Damien_The_Unbeliever
    Mar 28 at 9:31













0












0








0








I have an array of integers, and a short integer variable, I want to know if the value of this short integer exists in the array.



I tried using Contains, but I don't support short integer variables, so I can't help it.



 public List<Client> GetLogList(string userId,
string flagId,
string itemId,
int[] labIds,
string deviceId,
int[] actionType,
int? signStatus,
DateTime? startDate,
DateTime? endDate,
int pageIndex,
int pageSize)

DB.Queryable<Client, User, Item, Flag, ClientDevice, LogItem>
((clientOp, labUser, labItem, rfidFlag, clientDev, labUseLog) =>
clientOp.DeviceId == clientDev.DeviceId
&& clientOp.Operator == labUser.UserId
&& clientOp.FlagId == rfidFlag.FlagId
&& rfidFlag.ItemId == labItem.ItemId
&& clientOp.Id == labUseLog.Id)
.WhereIF(!string.IsNullOrEmpty(userId), clientOp =>
clientOp.Operator == userId)
.WhereIF(!string.IsNullOrEmpty(flagId), clientOp =>
clientOp.FlagId == flagId)
.WhereIF(!string.IsNullOrEmpty(itemId), rfidFlag =>
rfidFlag.ItemId == Convert.ToInt32(itemId))
.WhereIF(!string.IsNullOrEmpty(deviceId), clientOp =>
clientOp.DeviceId == deviceId)
.WhereIF(actionType != null && actionType.Count() > 0,
clientOp => clientOp.ActionType.Contains(actionType)))










share|improve this question
















I have an array of integers, and a short integer variable, I want to know if the value of this short integer exists in the array.



I tried using Contains, but I don't support short integer variables, so I can't help it.



 public List<Client> GetLogList(string userId,
string flagId,
string itemId,
int[] labIds,
string deviceId,
int[] actionType,
int? signStatus,
DateTime? startDate,
DateTime? endDate,
int pageIndex,
int pageSize)

DB.Queryable<Client, User, Item, Flag, ClientDevice, LogItem>
((clientOp, labUser, labItem, rfidFlag, clientDev, labUseLog) =>
clientOp.DeviceId == clientDev.DeviceId
&& clientOp.Operator == labUser.UserId
&& clientOp.FlagId == rfidFlag.FlagId
&& rfidFlag.ItemId == labItem.ItemId
&& clientOp.Id == labUseLog.Id)
.WhereIF(!string.IsNullOrEmpty(userId), clientOp =>
clientOp.Operator == userId)
.WhereIF(!string.IsNullOrEmpty(flagId), clientOp =>
clientOp.FlagId == flagId)
.WhereIF(!string.IsNullOrEmpty(itemId), rfidFlag =>
rfidFlag.ItemId == Convert.ToInt32(itemId))
.WhereIF(!string.IsNullOrEmpty(deviceId), clientOp =>
clientOp.DeviceId == deviceId)
.WhereIF(actionType != null && actionType.Count() > 0,
clientOp => clientOp.ActionType.Contains(actionType)))







c#






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 8:48









Joel

1,41514 silver badges29 bronze badges




1,41514 silver badges29 bronze badges










asked Mar 28 at 8:26









James ZhangJames Zhang

1




1















  • You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?

    – James Zhang
    Mar 28 at 8:51











  • I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.

    – Damien_The_Unbeliever
    Mar 28 at 8:52











  • Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.

    – James Zhang
    Mar 28 at 9:00











  • And it wasn't just to write actionType.Contains(clientOp.ActionType)?

    – Damien_The_Unbeliever
    Mar 28 at 9:31

















  • You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?

    – James Zhang
    Mar 28 at 8:51











  • I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.

    – Damien_The_Unbeliever
    Mar 28 at 8:52











  • Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.

    – James Zhang
    Mar 28 at 9:00











  • And it wasn't just to write actionType.Contains(clientOp.ActionType)?

    – Damien_The_Unbeliever
    Mar 28 at 9:31
















You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?

– James Zhang
Mar 28 at 8:51





You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?

– James Zhang
Mar 28 at 8:51













I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.

– Damien_The_Unbeliever
Mar 28 at 8:52





I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.

– Damien_The_Unbeliever
Mar 28 at 8:52













Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.

– James Zhang
Mar 28 at 9:00





Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.

– James Zhang
Mar 28 at 9:00













And it wasn't just to write actionType.Contains(clientOp.ActionType)?

– Damien_The_Unbeliever
Mar 28 at 9:31





And it wasn't just to write actionType.Contains(clientOp.ActionType)?

– Damien_The_Unbeliever
Mar 28 at 9:31












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55393022%2fhow-to-determine-if-there-is-a-specific-short-integer-variable-value-in-the-arra%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55393022%2fhow-to-determine-if-there-is-a-specific-short-integer-variable-value-in-the-arra%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?