Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8422259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:23:49+00:00 2026-06-10T03:23:49+00:00

My code is : var serverManager = new ServerManager(); var regex = new Regex(^(http|https)://);

  • 0

My code is :

var serverManager = new ServerManager();
var regex = new Regex("^(http|https)://");
var host = regex.Replace(url, "");
var instance = serverManager.Sites.First(
    site => site.Bindings.First(
        binding => binding.Host == host
    )
);

You can see I try to do a second select on the attribute of the first one because Bindings is a collection and I need a particular item of this collection. I get this error :

Cannot implicitly convert type 'Microsoft.Web.Administration.Binding' to 'Bool'.

Any idea to resolve that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:23:51+00:00Added an answer on June 10, 2026 at 3:23 am

    You’re looking for

    var instance = serverManager.Sites.First(
        site => site.Bindings.Any(
            binding => binding.Host == host
        )
    );
    

    site.Bindings.First(binding => binding.Host == host) returns a Binding, but it inside of serverManager.Sites.First(...), which in turn expects a predicate (returning a bool), not a Binding.

    The snippet above uses Any to get the first site which has a binding with Host == host.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my code: var req = new XMLHttpRequest(); req.open(GET,http://http://surfkid.redio.de/link.php); req.send(null); var textout = var.responseText; document.write(textout);
Check the code var server = http.createServer(function(req, res){ var parsedUrl = require('url').parse(req.url); var pathname
The code: var Appointment = Backbone.Model.extend({}); var appointment = new Appointment(); appointment.set('title', 'My knee
This is my code: var boo = new RegExp(\\Bis\\B,gi); var result = boo.exec(this AisA
Code: var myPattern:RegExp = /\/; trace(a.replace(myPattern, \\\)); <TEXTFORMAT LEADING=\2><P ALIGN=LEFT><FONT FACE=Verdana SIZE=10 COLOR=#0B333C LETTERSPACING=0
Checking the simple code var http = require('http'); var server = http.createServer(function(req, res){ console.log(Got
This code: var customers = from cust in Customers group cust by new {cust.Country}
Hello i have this code var queue = new BlockingCollection<int>(); queue.Add(0); var producers =
My code: var list = new LinkedList<int>(); var ramCounter = new PerformanceCounter(Memory, Available MBytes);
server code var http = require('http'), io = require('socket.io'), fs = require('fs'); respcont =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.